Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanli
evm-store
Commits
12f16b50
Commit
12f16b50
authored
Jul 22, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(): 修复路径获取错误问题
parent
3891d340
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
.gitignore
.gitignore
+1
-0
tools/build_out/controllers/api.py
tools/build_out/controllers/api.py
+3
-3
tools/build_out/controllers/app.py
tools/build_out/controllers/app.py
+2
-2
No files found.
.gitignore
View file @
12f16b50
...
...
@@ -55,6 +55,7 @@ backend/backupData.json
config.ini
*.epk
tools/build_out/application/config.py
tools/build_out/logs
tools/build_out/logs/*
...
...
tools/build_out/controllers/api.py
View file @
12f16b50
'''
Author: your name
Date: 2021-07-12 11:14:48
LastEditTime: 2021-07-2
0 17:11:57
LastEditTime: 2021-07-2
2 14:56:12
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\
controllers
\a
ppi.py
...
...
@@ -100,7 +100,7 @@ class BuildAppResource(object):
dst_file
=
dest_dir
.
joinpath
(
name
+
suffix
)
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
.
flush
()
db
.
session
.
commit
()
...
...
@@ -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
()
if
result
:
...
...
tools/build_out/controllers/app.py
View file @
12f16b50
...
...
@@ -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
()
if
package
:
...
...
@@ -215,7 +215,7 @@ class AppResource(object):
epk
=
EpkApp
(
**
params
)
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
:
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment