Exemplo n.º 1
0
def save():
    data = request.get_json()  # 接收js传递来的数据
    if data['idx'] == session['id']:
        note = Note(NOTEROOT)
        print(f"正在保存操作{session['id']}")
        note.locate(session['type'], session['id'])
        #
        note.title = data['title']
        note.keywords = data['keywords']
        note.content = data['content']
        note.update("Save")
    else:
        print(f"id不同:{data['idx']} <> {session['id']}")
    return "保存完毕"
Exemplo n.º 2
0
def archive():
    data = request.get_json()  # print("保存内容",data)
    #
    if data['idx'] == session['id']:
        note = Note(NOTEROOT)
        print(f"正在存档操作{session['id']}")
        note.locate(session['type'], session['id'])
        #
        note.title = data['title']
        note.keywords = data['keywords']
        note.content = data['content']
        note.update("Archive")
    else:
        print(f"id不同:{data['idx']} <> {session['id']}")
    return "存档完毕"