Commit 12f16b50 authored by wanli's avatar wanli

🐞 fix(): 修复路径获取错误问题

parent 3891d340
...@@ -55,6 +55,7 @@ backend/backupData.json ...@@ -55,6 +55,7 @@ backend/backupData.json
config.ini config.ini
*.epk *.epk
tools/build_out/application/config.py
tools/build_out/logs tools/build_out/logs
tools/build_out/logs/* tools/build_out/logs/*
......
''' '''
Author: your name Author: your name
Date: 2021-07-12 11:14:48 Date: 2021-07-12 11:14:48
LastEditTime: 2021-07-20 17:11:57 LastEditTime: 2021-07-22 14:56:12
LastEditors: Please set LastEditors LastEditors: Please set LastEditors
Description: In User Settings Edit Description: In User Settings Edit
FilePath: \evm-store\tools\build_out\controllers\appi.py FilePath: \evm-store\tools\build_out\controllers\appi.py
...@@ -100,7 +100,7 @@ class BuildAppResource(object): ...@@ -100,7 +100,7 @@ class BuildAppResource(object):
dst_file = dest_dir.joinpath(name + suffix) dst_file = dest_dir.joinpath(name + suffix)
shutil.copy(os.path.normpath(target_file), dst_file.resolve().as_posix()) shutil.copy(os.path.normpath(target_file), dst_file.resolve().as_posix())
res = AnnexModel(app=app.id, title=filename, path=dst_file.relative_to(config.UPLOAD_ROOT_DIR).resolve().as_posix(), size=dst_file.stat().st_size, create_by=user.id, create_at=datetime.now(), update_by=user.id, update_at=datetime.now()) res = AnnexModel(app=app.id, title=filename, path=dst_file.relative_to(config.UPLOAD_ROOT_DIR).as_posix(), size=dst_file.stat().st_size, create_by=user.id, create_at=datetime.now(), update_by=user.id, update_at=datetime.now())
db.session.add(res) db.session.add(res)
db.session.flush() db.session.flush()
db.session.commit() db.session.commit()
...@@ -116,7 +116,7 @@ class BuildAppResource(object): ...@@ -116,7 +116,7 @@ class BuildAppResource(object):
# 更新数据库对应文件路径 # 更新数据库对应文件路径
# 将文件拷贝过去后,需要重新更新数据库文件记录 # 将文件拷贝过去后,需要重新更新数据库文件记录
epk_path = target_dir.relative_to(config.UPLOAD_ROOT_DIR).joinpath("{}.epk".format(app.app_name)).resolve().as_posix() epk_path = target_dir.relative_to(config.UPLOAD_ROOT_DIR).joinpath("{}.epk".format(app.app_name)).as_posix()
result = PackageModel.query.filter(PackageModel.app==app.id).one_or_none() result = PackageModel.query.filter(PackageModel.app==app.id).one_or_none()
if result: if result:
......
...@@ -89,7 +89,7 @@ class AppResource(object): ...@@ -89,7 +89,7 @@ class AppResource(object):
# 更新数据库对应文件路径 # 更新数据库对应文件路径
# 将文件拷贝过去后,需要重新更新数据库文件记录 # 将文件拷贝过去后,需要重新更新数据库文件记录
epk_path = target_dir.relative_to(config.UPLOAD_ROOT_DIR).joinpath("{}.epk".format(app.app_name)).resolve().as_posix() epk_path = target_dir.joinpath("{}.epk".format(app.app_name)).relative_to(config.UPLOAD_ROOT_DIR).as_posix()
package = PackageModel.query.filter(PackageModel.app==app.id).one_or_none() package = PackageModel.query.filter(PackageModel.app==app.id).one_or_none()
if package: if package:
...@@ -215,7 +215,7 @@ class AppResource(object): ...@@ -215,7 +215,7 @@ class AppResource(object):
epk = EpkApp(**params) epk = EpkApp(**params)
app_info = epk.pack() app_info = epk.pack()
epk_filename = epk_path.parent.relative_to(config.UPLOAD_ROOT_DIR).joinpath("{}.epk".format(app.app_name)).resolve().as_posix() epk_filename = epk_path.parent.relative_to(config.UPLOAD_ROOT_DIR).joinpath("{}.epk".format(app.app_name)).as_posix()
if app_info: if app_info:
app_info['md5'] = str(app_info['md5']) app_info['md5'] = str(app_info['md5'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment