删除历史版本, 初始化仓库

This commit is contained in:
MarkusJoe
2022-06-02 18:50:09 +08:00
commit 91c9c2ba7c
37 files changed
+1773

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/4/9
# @File Name: errors.py
from . import api
from .auth import auth
from flask import jsonify
@api.errorhandler(403)
@auth.error_handler
def forbidden(e):
return jsonify(
{
'code': 403,
'msg': 'API: Permission Denied.',
'data': None
}
), 403
@api.errorhandler(404)
def page_not_found(e):
return jsonify(
{
'code': 404,
'msg': 'API: Page Not Found.',
'data': None
}
), 404
@api.errorhandler(500)
def internal_server_error(e):
return jsonify(
{
'code': 500,
'msg': 'API: Internal Server Error.',
'data': None
}
), 500