Archived
feat: fix
This commit is contained in:
3 files changed
+15
-20
No files matched your search
@@ -12,6 +12,7 @@ from flask import request
|
||||
from flask import Response
|
||||
from flask import make_response
|
||||
from flask import send_from_directory
|
||||
from gevent import pywsgi
|
||||
from bin.core.render_ import render_temp_
|
||||
from bin.core.b64img import re_sort_number_image
|
||||
from bin.core.length import make_html
|
||||
@@ -26,7 +27,7 @@ def error_length(length: int) -> Response:
|
||||
:param length:
|
||||
:return:
|
||||
"""
|
||||
response = make_response({'code': 200,
|
||||
response = make_response({'code': -2,
|
||||
'message': f'错误的长度: {length}'})
|
||||
response.status_code = 200
|
||||
response.headers['Content-Type'] = 'application/json; charset=utf-8'
|
||||
@@ -42,7 +43,7 @@ def too_lang_to_count(name: str) -> Response:
|
||||
:return:
|
||||
"""
|
||||
update_data(name, 0)
|
||||
response = make_response({'code': 200,
|
||||
response = make_response({'code': -2,
|
||||
'message': f'当前长度超过了最大可计数长度:10. 已将重置该名称的计数器'})
|
||||
response.headers['Content-Type'] = 'application/json; charset=utf-8'
|
||||
response.headers['cache-control'] = 'max-age=0, no-cache, no-store, must-revalidate'
|
||||
@@ -55,7 +56,7 @@ def arg_not_be_full() -> Response:
|
||||
参数不完整
|
||||
:return:
|
||||
"""
|
||||
response = make_response({'code': 200,
|
||||
response = make_response({'code': -2,
|
||||
'message': '参数填写不完整或填写错误'})
|
||||
response.status_code = 200
|
||||
response.headers['Content-Type'] = 'application/json; charset=utf-8'
|
||||
@@ -127,4 +128,8 @@ def index():
|
||||
|
||||
if __name__ == '__main__':
|
||||
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 端口被占用')
|
||||
@@ -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
|
||||
@@ -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 |
Reference in New Issue
Block a user