Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
76520487
Commit
76520487
authored
May 17, 2020
by
高宇强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
190a5a33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletions
+26
-1
ailogo/LogoManage.py
+18
-1
ailogo/main.py
+8
-0
No files found.
ailogo/LogoManage.py
View file @
76520487
...
@@ -5,8 +5,9 @@ import pymysql,requests
...
@@ -5,8 +5,9 @@ import pymysql,requests
import
random
import
random
import
re
import
re
import
customizelogosmall
import
customizelogosmall
import
json
import
os
import
time
import
time
import
shutil
from
threading
import
Thread
from
threading
import
Thread
#随机取50个descid,其中15个模板id,35个logoid
#随机取50个descid,其中15个模板id,35个logoid
...
@@ -461,3 +462,19 @@ def ReturnLogoInfo(inputdata,curpage,pagesize):
...
@@ -461,3 +462,19 @@ def ReturnLogoInfo(inputdata,curpage,pagesize):
return
False
,
0
,
[]
return
False
,
0
,
[]
except
:
except
:
return
False
,
0
,
[]
return
False
,
0
,
[]
#删除临时文件
def
Deletefile
():
try
:
dirlist
=
[
"data"
,
"downlogo"
,
"generatordir"
,
"logodir"
]
for
dir
in
dirlist
:
for
root
,
dirs
,
files
in
os
.
walk
(
dir
):
for
name
in
files
:
os
.
remove
(
os
.
path
.
join
(
root
,
name
))
for
name
in
dirs
:
shutil
.
rmtree
(
os
.
path
.
join
(
root
,
name
))
return
True
except
Exception
as
e
:
print
(
str
(
e
))
return
False
ailogo/main.py
View file @
76520487
...
@@ -212,6 +212,14 @@ def CreateLogoApi():#得到场景信息
...
@@ -212,6 +212,14 @@ def CreateLogoApi():#得到场景信息
return
json
.
dumps
({
"status"
:
-
1
,
"msg"
:
"调用服务出错"
,
"data"
:
""
},
ensure_ascii
=
False
)
return
json
.
dumps
({
"status"
:
-
1
,
"msg"
:
"调用服务出错"
,
"data"
:
""
},
ensure_ascii
=
False
)
@app.route
(
'/api/deletefile'
,
methods
=
[
'POST'
])
def
DeletefileApi
():
#删除临时文件
istrue
=
LogoManage
.
Deletefile
()
if
istrue
:
return
json
.
dumps
({
"status"
:
0
,
"msg"
:
"删除成功"
},
ensure_ascii
=
False
)
else
:
return
json
.
dumps
({
"status"
:
-
1
,
"msg"
:
"删除失败"
},
ensure_ascii
=
False
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
CORS
(
app
,
supports_credentials
=
True
)
#允许跨域
CORS
(
app
,
supports_credentials
=
True
)
#允许跨域
app
.
run
(
host
=
'0.0.0.0'
,
port
=
80
,
debug
=
True
)
app
.
run
(
host
=
'0.0.0.0'
,
port
=
80
,
debug
=
True
)
...
...
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