增加使用上次数据的选择,同时将自动解密微信数据改为重新解密数据库,获取最新数据
This commit is contained in:
parent
f7ca72748f
commit
955ced8173
@ -38,17 +38,23 @@ def init():
|
||||
wx_path = request.json.get("wx_path", "").strip()
|
||||
key = request.json.get("key", "").strip()
|
||||
my_wxid = request.json.get("my_wxid", "").strip()
|
||||
init_type = request.json.get("init_type", "").strip()
|
||||
|
||||
if init_type == "last":
|
||||
save_msg_path = read_session(g.sf, "msg_path")
|
||||
save_micro_path = read_session(g.sf, "micro_path")
|
||||
save_my_wxid = read_session(g.sf, "my_wxid")
|
||||
if save_msg_path and save_micro_path and os.path.exists(save_msg_path) and os.path.exists(
|
||||
save_micro_path):
|
||||
return ReJson(0, {"msg_path": save_msg_path, "micro_path": save_micro_path, "is_init": True})
|
||||
else:
|
||||
return ReJson(1002,body="上次初始化的路径不存在")
|
||||
|
||||
if key: # 如果key不为空,表示是解密模式
|
||||
if not wx_path:
|
||||
return ReJson(1002)
|
||||
if not os.path.exists(wx_path):
|
||||
return ReJson(1001, body=wx_path)
|
||||
save_msg_path = read_session(g.sf, "msg_path")
|
||||
save_micro_path = read_session(g.sf, "micro_path")
|
||||
save_my_wxid = read_session(g.sf, "my_wxid")
|
||||
if save_msg_path and save_micro_path and os.path.exists(save_msg_path) and os.path.exists(
|
||||
save_micro_path) and save_my_wxid == my_wxid:
|
||||
return ReJson(0, {"msg_path": save_msg_path, "micro_path": save_micro_path, "is_init": True})
|
||||
|
||||
out_path = os.path.join(g.tmp_path, "decrypted", my_wxid) if my_wxid else os.path.join(g.tmp_path,
|
||||
"decrypted")
|
||||
@ -191,6 +197,7 @@ def contact_count_list():
|
||||
except Exception as e:
|
||||
return ReJson(9999, msg=str(e))
|
||||
|
||||
|
||||
@api.route('/api/msgs_user_list', methods=['GET', 'POST'])
|
||||
@error9999
|
||||
def get_msg_user_list():
|
||||
@ -219,6 +226,7 @@ def get_msg_user_list():
|
||||
userlist.append(my_user)
|
||||
return ReJson(0, {"user_list": userlist})
|
||||
|
||||
|
||||
@api.route('/api/msgs_list', methods=['GET', 'POST'])
|
||||
@error9999
|
||||
def get_msg_list():
|
||||
@ -235,6 +243,7 @@ def get_msg_list():
|
||||
msg_list = analyzer.get_msg_list(msg_path, wxid, start_index=start, page_size=limit)
|
||||
return ReJson(0, {"msg_list": msg_list, 'my_wxid': my_wxid})
|
||||
|
||||
|
||||
@api.route('/api/msgs', methods=["GET", 'POST'])
|
||||
@error9999
|
||||
def get_msgs():
|
||||
@ -302,6 +311,7 @@ def get_video(videoPath):
|
||||
return ReJson(5002)
|
||||
return send_file(all_video_path)
|
||||
|
||||
|
||||
@api.route('/api/file_info', methods=["GET", 'POST'])
|
||||
def get_file_info():
|
||||
file_path = request.args.get("file_path")
|
||||
@ -316,6 +326,7 @@ def get_file_info():
|
||||
file_size = os.path.getsize(all_file_path)
|
||||
return ReJson(0, {"file_name": file_name, "file_size": str(file_size)})
|
||||
|
||||
|
||||
@api.route('/api/file/<path:filePath>', methods=["GET", 'POST'])
|
||||
def get_file(filePath):
|
||||
wx_path = read_session(g.sf, "wx_path")
|
||||
@ -324,6 +335,7 @@ def get_file(filePath):
|
||||
return ReJson(5002)
|
||||
return send_file(all_file_path)
|
||||
|
||||
|
||||
@api.route('/api/audio/<path:savePath>', methods=["GET", 'POST'])
|
||||
def get_audio(savePath):
|
||||
# savePath = request.args.get("savePath")
|
||||
|
Loading…
Reference in New Issue
Block a user