|
|
@@ -35,11 +35,11 @@ def on_message(client, server, data):
|
|
|
file_id = data['params'].get('file_id')
|
|
|
is_template = data['params'].get('is_template')
|
|
|
# 判断是否为exe模式执行
|
|
|
-
|
|
|
+ work_path = os.path.join(args['work_path'], args['username'])
|
|
|
if is_template:
|
|
|
file_info = server_client.get_template_file_info(file_id)
|
|
|
time_str = datetime.datetime.now().strftime('%Y-%m-%dT%H-%M-%S')
|
|
|
- local_path = os.path.join(args['work_path'],
|
|
|
+ local_path = os.path.join(work_path,
|
|
|
f'{file_info["name"]}({time_str}).{file_info["nameSuffix"]}')
|
|
|
|
|
|
if server_client.download_template(file_info['fileLink'], local_path):
|
|
|
@@ -51,11 +51,11 @@ def on_message(client, server, data):
|
|
|
if not file_info:
|
|
|
return ws_send(client, server, {'code': 3006, 'msg': '文件不存在'})
|
|
|
logger.info(f'args:{args}, file_info:{file_info}')
|
|
|
- local_file = os.path.join(args['work_path'], file_info['filePath'].replace('/', '_'))
|
|
|
+ local_file = os.path.join(work_path, file_info['filePath'].replace('/', '_'))
|
|
|
|
|
|
# 判断本地是否存在已下载的同名文件
|
|
|
if not os.path.exists(local_file) or not os.path.exists(local_file + '.metadata.json'):
|
|
|
- server_client.download_file(file_info, args['work_path'])
|
|
|
+ server_client.download_file(file_info, work_path)
|
|
|
|
|
|
return ws_send(client, server, open_file_by_wps(local_file))
|
|
|
|