管理后台 server 使用蓝图模式,降低维护成本,降低修改功能时对其他模块的影响
This commit is contained in:
@@ -7,7 +7,7 @@ contacts_bp = Blueprint('contacts', __name__, url_prefix='/contacts')
|
|||||||
logger = logging.getLogger("ContactsBlueprint")
|
logger = logging.getLogger("ContactsBlueprint")
|
||||||
|
|
||||||
# 联系人管理页面
|
# 联系人管理页面
|
||||||
@contacts_bp.route('/')
|
@contacts_bp.route('/contacts')
|
||||||
@login_required
|
@login_required
|
||||||
def contacts_management():
|
def contacts_management():
|
||||||
"""通讯录管理页面"""
|
"""通讯录管理页面"""
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ messages_bp = Blueprint('messages', __name__, url_prefix='/messages')
|
|||||||
logger = logging.getLogger("MessagesBlueprint")
|
logger = logging.getLogger("MessagesBlueprint")
|
||||||
|
|
||||||
# 消息列表页面
|
# 消息列表页面
|
||||||
@messages_bp.route('/')
|
@messages_bp.route('/messages')
|
||||||
@login_required
|
@login_required
|
||||||
def message_list_page():
|
def message_list_page():
|
||||||
"""消息列表页面"""
|
"""消息列表页面"""
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ robot_bp = Blueprint('robot', __name__, url_prefix='/robot')
|
|||||||
logger = logging.getLogger("RobotBlueprint")
|
logger = logging.getLogger("RobotBlueprint")
|
||||||
|
|
||||||
# 机器人管理页面
|
# 机器人管理页面
|
||||||
@robot_bp.route('/')
|
@robot_bp.route('/robot_management')
|
||||||
@login_required
|
@login_required
|
||||||
def robot_management():
|
def robot_management():
|
||||||
return render_template('robot_management.html')
|
return render_template('robot_management.html')
|
||||||
|
|||||||
@@ -129,9 +129,9 @@ class DashboardServer:
|
|||||||
# 注册蓝图
|
# 注册蓝图
|
||||||
app.register_blueprint(auth_bp)
|
app.register_blueprint(auth_bp)
|
||||||
app.register_blueprint(main_bp)
|
app.register_blueprint(main_bp)
|
||||||
app.register_blueprint(contacts_bp, url_prefix='/contacts')
|
app.register_blueprint(contacts_bp)
|
||||||
app.register_blueprint(robot_bp, url_prefix='/robot')
|
app.register_blueprint(robot_bp)
|
||||||
app.register_blueprint(messages_bp, url_prefix='/messages')
|
app.register_blueprint(messages_bp)
|
||||||
app.register_blueprint(stats_bp)
|
app.register_blueprint(stats_bp)
|
||||||
app.register_blueprint(system_bp)
|
app.register_blueprint(system_bp)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user