feature: 错误页面返回

This commit is contained in:
zhengxinonly
2023-10-29 17:04:05 +08:00
parent 261ac32825
commit 6a8fb955f5
10 changed files with 641 additions and 208 deletions
+13 -1
View File
@@ -1,4 +1,4 @@
from flask import Flask
from flask import Flask, render_template
from configs import config
from pear_admin.apis import register_apis
@@ -17,4 +17,16 @@ def create_app(config_name="dev"):
register_views(app)
@app.errorhandler(403)
def handle_404(e):
return render_template("error/403.html")
@app.errorhandler(404)
def handle_403(e):
return render_template("error/404.html")
@app.errorhandler(500)
def handle_500(e):
return render_template("error/500.html")
return app