feat: upload

This commit is contained in:
MarkusJoe
2022-02-04 12:17:28 +08:00
parent 33108ad274
commit 55f9f9a1d2
6 files changed
+16 -6

No files matched your search

+12 -2
View File
@@ -97,8 +97,10 @@ def arg_not_be_full() -> Response:
参数不完整
:return:
"""
response = make_response('<h2 style="text-align: center">参数填写不完整 -> name</h2>')
response = make_response({'code': 200,
'message': 'Incomplete parameters'})
response.status_code = 200
response.headers['Content-Type'] = 'application/json; charset=utf-8'
return response
@@ -109,7 +111,15 @@ def api_page() -> Response or str:
:return:
"""
if 'name' in request.args:
return build_page(request.args['name'])
name = request.args['name']
if name != '':
resp = build_page(name)
response = make_response(resp)
response.headers['Content-Type'] = 'image/svg+xml; charset=utf-8'
return response
else:
return arg_not_be_full()
else:
return arg_not_be_full()