diff --git a/README.md b/README.md index 569cad9..283b983 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ # 计数器 灵感: https://github.com/journey-ad/Moe-counter -![LocalCounter](http://127.0.0.1:5000/API?owner=sdsdsdsdsdsdawioruvniovenyrui) +![LocalCounter](http://127.0.0.1:5000/API?name=MarkusJoe) ![Moe-counter](https://count.getloli.com/get/@Moe-counter.github) diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc index a4561c3..df43083 100644 Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ diff --git a/app.py b/app.py index 1fd5170..74abb96 100644 --- a/app.py +++ b/app.py @@ -97,8 +97,10 @@ def arg_not_be_full() -> Response: 参数不完整 :return: """ - response = make_response('

参数填写不完整 -> name

') + 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() diff --git a/bin/__pycache__/b64img.cpython-310.pyc b/bin/__pycache__/b64img.cpython-310.pyc index 3403216..d02c0ea 100644 Binary files a/bin/__pycache__/b64img.cpython-310.pyc and b/bin/__pycache__/b64img.cpython-310.pyc differ diff --git a/static/data.json b/static/data.json index 40452ab..b3ff4c8 100644 --- a/static/data.json +++ b/static/data.json @@ -1 +1 @@ -{"MarkusJoe": 26, "Mar": 3, "M": 1, "": 5, "oo": 20} \ No newline at end of file +{"MarkusJoe": 27, "Mar": 4, "M": 2, "": 23, "oo": 103, "sdhi": 8, "sdsdsdsdsdsdawioruvniovenyrui": 0, "rui": 11, "ru": 0, "r": 0, "rr": 0, "Ma": 0, "Mark": 0, "Marku": 0, "Markus": 0, "MarkusK": 0, "MarkusKe": 0, "MarkusJ": 0, "MarkusJo": 0} \ No newline at end of file diff --git a/static/index.html b/static/index.html index f2ed4e5..358c6dc 100644 --- a/static/index.html +++ b/static/index.html @@ -15,9 +15,9 @@
本服务使用Python-Flask开发(Flask 官方地址:Flask )
- 调用示例: 127.0.0.1:5000/API>owner=main 注: 调用只能使用GET方法请求 + 调用示例: 127.0.0.1:5000/API?name=main 注: 调用支持POST 和 GET 方法请求
- 已经搭建好的私人服务器调用地址: + 已经搭建好的私人服务器调用地址:
数字图片作者: 碎蜂