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
8ac587bd
Commit
8ac587bd
authored
Jul 22, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(): 更新后端打包接口
parent
42ec638e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
tools/build_out/controllers/api.py
tools/build_out/controllers/api.py
+8
-4
No files found.
tools/build_out/controllers/api.py
View file @
8ac587bd
'''
'''
Author: your name
Author: your name
Date: 2021-07-12 11:14:48
Date: 2021-07-12 11:14:48
LastEditTime: 2021-07-22 18:
00:06
LastEditTime: 2021-07-22 18:
11:13
LastEditors: Please set LastEditors
LastEditors: Please set LastEditors
Description: In User Settings Edit
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\
controllers
\a
ppi.py
FilePath:
\
evm-store
\t
ools
\b
uild_out
\
controllers
\a
ppi.py
...
@@ -112,23 +112,27 @@ class BuildAppResource(object):
...
@@ -112,23 +112,27 @@ class BuildAppResource(object):
params
=
{
'appName'
:
app
.
app_name
,
'appDir'
:
dest_dir
.
resolve
()
.
as_posix
(),
'appVersion'
:
app
.
app_version
,
'output'
:
target_dir
.
resolve
()
.
as_posix
()
}
params
=
{
'appName'
:
app
.
app_name
,
'appDir'
:
dest_dir
.
resolve
()
.
as_posix
(),
'appVersion'
:
app
.
app_version
,
'output'
:
target_dir
.
resolve
()
.
as_posix
()
}
if
user
.
role
==
1
:
if
user
.
role
==
1
:
params
[
'algorithm'
]
=
"h"
params
[
'algorithm'
]
=
"h"
else
:
params
[
'algorithm'
]
=
"zlib"
epk
=
EpkApp
(
**
params
)
epk
=
EpkApp
(
**
params
)
app_info
=
epk
.
pack
()
app_info
=
epk
.
pack
()
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
# 更新数据库对应文件路径
# 更新数据库对应文件路径
# 将文件拷贝过去后,需要重新更新数据库文件记录
# 将文件拷贝过去后,需要重新更新数据库文件记录
epk_path
=
target_dir
.
relative_to
(
config
.
UPLOAD_ROOT_DIR
)
.
joinpath
(
"{}.epk"
.
format
(
app
.
app_name
))
.
as_posix
()
epk_path
=
target_dir
.
joinpath
(
"{}.epk"
.
format
(
app
.
app_name
))
.
relative_to
(
config
.
UPLOAD_ROOT_DIR
)
.
as_posix
()
app
.
download_url
=
epk_path
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
:
result
.
algorithm
=
params
[
'algorithm'
]
result
.
app_path
=
epk_path
result
.
app_path
=
epk_path
result
.
app_info
=
app_info
result
.
package_info
=
json
.
dumps
(
app_info
,
ensure_ascii
=
False
)
result
.
update_by
=
user
result
.
update_by
=
user
result
.
update_at
=
datetime
.
now
()
result
.
update_at
=
datetime
.
now
()
db
.
session
.
commit
()
db
.
session
.
commit
()
else
:
else
:
result
=
PackageModel
(
app
=
app
.
id
,
file_path
=
epk_path
,
package_info
=
json
.
dumps
(
app_info
,
ensure_ascii
=
False
),
a
pp_version
=
params
.
get
(
"app_version"
,
'1.0.0'
),
source
=
2
,
create_by
=
user
.
id
,
create_at
=
datetime
.
now
(),
update_by
=
user
.
id
,
update_at
=
datetime
.
now
())
result
=
PackageModel
(
app
=
app
.
id
,
file_path
=
epk_path
,
package_info
=
json
.
dumps
(
app_info
,
ensure_ascii
=
False
),
a
lgorithm
=
params
[
'algorithm'
],
app_version
=
params
.
get
(
"app_version"
,
'1.0.0'
),
source
=
1
,
create_by
=
user
.
id
,
create_at
=
datetime
.
now
(),
update_by
=
user
.
id
,
update_at
=
datetime
.
now
())
db
.
session
.
add
(
result
)
db
.
session
.
add
(
result
)
db
.
session
.
commit
()
db
.
session
.
commit
()
...
...
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