管理后台 server 使用蓝图模式,降低维护成本,降低修改功能时对其他模块的影响
This commit is contained in:
10
admin/dashboard/blueprints/main.py
Normal file
10
admin/dashboard/blueprints/main.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from flask import Blueprint, render_template
|
||||
from .auth import login_required
|
||||
|
||||
# 创建主页蓝图
|
||||
main_bp = Blueprint('main', __name__)
|
||||
|
||||
@main_bp.route('/')
|
||||
@login_required
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
Reference in New Issue
Block a user