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
9383eeb7
Commit
9383eeb7
authored
Aug 10, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(view/api.py):修复一处代码安全隐患
parent
1566733f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
.gitignore
.gitignore
+1
-0
backend/view/api.py
backend/view/api.py
+13
-4
No files found.
.gitignore
View file @
9383eeb7
...
...
@@ -54,6 +54,7 @@ backend/backupData.json
*/app-store.db
config.ini
*.epk
*.bc
tools/build_out/application/config.py
tools/build_out/logs
...
...
backend/view/api.py
View file @
9383eeb7
...
...
@@ -170,6 +170,10 @@ def action_build():
z
=
zipfile
.
ZipFile
(
zip_filepath
,
'w'
)
for
f
in
request
.
files
.
getlist
(
'binfile'
):
target
=
target_path
.
joinpath
(
f
.
filename
)
if
target
.
suffix
!=
".evue"
:
continue
with
open
(
target
.
resolve
()
.
as_posix
(),
"wb+"
)
as
fd
:
fd
.
write
(
f
.
stream
.
read
())
...
...
@@ -198,10 +202,15 @@ def action_build():
shutil
.
move
(
file
.
resolve
()
.
as_posix
(),
target_path
.
joinpath
(
file
.
name
)
.
resolve
()
.
as_posix
())
# 压缩
z
.
close
()
result
=
Path
(
zip_filepath
)
.
resolve
()
.
relative_to
(
Path
(
config
.
get
(
"UPLOAD_PATH"
)))
.
as_posix
()
return
response_result
(
ResponseCode
.
OK
,
data
=
result
)
if
len
(
dst_files
):
z
.
close
()
result
=
Path
(
zip_filepath
)
.
resolve
()
.
relative_to
(
Path
(
config
.
get
(
"UPLOAD_PATH"
)))
.
as_posix
()
return
response_result
(
ResponseCode
.
OK
,
data
=
{
'url'
:
result
,
'filename'
:
os
.
path
.
basename
(
zip_filepath
)
})
else
:
return
response_result
(
ResponseCode
.
SERVER_ERROR
)
@
api
.
route
(
"/monitor"
,
methods
=
[
'GET'
,
'POST'
])
def
action_monitor
():
...
...
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