feat(api): 新增 CSRF 校验

This commit is contained in:
不胜舟
2025-09-02 11:37:27 +08:00
parent 000330dbd7
commit 5bcc28a492
5 changed files with 20 additions and 2 deletions
+5 -1
View File
@@ -10,6 +10,10 @@ def init_error_views(app):
def page_not_found(e):
return render_template('errors/404.html'), 404
@app.errorhandler(405)
def page_not_found(e):
return render_template('errors/404.html'), 404
@app.errorhandler(500)
def internal_server_error(e):
return render_template('errors/500.html'), 500
@@ -18,4 +22,4 @@ def init_error_views(app):
def ratelimit_exceeded(e):
return jsonify(
success=False, msg="请求频率超限,请稍后再试。"
)
)