feat: fix

This commit is contained in:
MarkusJoe
2022-02-06 13:02:01 +08:00
parent 17e687653a
commit c84db879d5
3 files changed
+15 -20

No files matched your search

+9 -4
View File
@@ -12,6 +12,7 @@ from flask import request
from flask import Response from flask import Response
from flask import make_response from flask import make_response
from flask import send_from_directory from flask import send_from_directory
from gevent import pywsgi
from bin.core.render_ import render_temp_ from bin.core.render_ import render_temp_
from bin.core.b64img import re_sort_number_image from bin.core.b64img import re_sort_number_image
from bin.core.length import make_html from bin.core.length import make_html
@@ -26,7 +27,7 @@ def error_length(length: int) -> Response:
:param length: :param length:
:return: :return:
""" """
response = make_response({'code': 200, response = make_response({'code': -2,
'message': f'错误的长度: {length}'}) 'message': f'错误的长度: {length}'})
response.status_code = 200 response.status_code = 200
response.headers['Content-Type'] = 'application/json; charset=utf-8' response.headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -42,7 +43,7 @@ def too_lang_to_count(name: str) -> Response:
:return: :return:
""" """
update_data(name, 0) update_data(name, 0)
response = make_response({'code': 200, response = make_response({'code': -2,
'message': f'当前长度超过了最大可计数长度:10. 已将重置该名称的计数器'}) 'message': f'当前长度超过了最大可计数长度:10. 已将重置该名称的计数器'})
response.headers['Content-Type'] = 'application/json; charset=utf-8' response.headers['Content-Type'] = 'application/json; charset=utf-8'
response.headers['cache-control'] = 'max-age=0, no-cache, no-store, must-revalidate' response.headers['cache-control'] = 'max-age=0, no-cache, no-store, must-revalidate'
@@ -55,7 +56,7 @@ def arg_not_be_full() -> Response:
参数不完整 参数不完整
:return: :return:
""" """
response = make_response({'code': 200, response = make_response({'code': -2,
'message': '参数填写不完整或填写错误'}) 'message': '参数填写不完整或填写错误'})
response.status_code = 200 response.status_code = 200
response.headers['Content-Type'] = 'application/json; charset=utf-8' response.headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -127,4 +128,8 @@ def index():
if __name__ == '__main__': if __name__ == '__main__':
print('服务器已在http://127.0.0.1:5000 运行') print('服务器已在http://127.0.0.1:5000 运行')
app.run(threaded=True) try:
server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
server.serve_forever()
except OSError:
print('5000 端口被占用')
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/2/6
# @File Name: logger.py
-16
View File
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="450" height="50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>{{ title }}</title>
<g>
<image x="0" y="0" width="45" height="50" xlink:href="{{ svg_img_0 }}"></image>
<image x="45" y="0" width="45" height="50" xlink:href="{{ svg_img_1 }}"></image>
<image x="90" y="0" width="45" height="50" xlink:href="{{ svg_img_2 }}"></image>
<image x="135" y="0" width="45" height="50" xlink:href="{{ svg_img_3 }}"></image>
<image x="180" y="0" width="45" height="50" xlink:href="{{ svg_img_4 }}"></image>
<image x="225" y="0" width="45" height="50" xlink:href="{{ svg_img_5 }}"></image>
<image x="270" y="0" width="45" height="50" xlink:href="{{ svg_img_6 }}"></image>
<image x="315" y="0" width="45" height="50" xlink:href="{{ svg_img_7 }}"></image>
<image x="360" y="0" width="45" height="50" xlink:href="{{ svg_img_8 }}"></image>
<image x="405" y="0" width="45" height="50" xlink:href="{{ svg_img_9 }}"></image>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB