管理后台 server 使用蓝图模式,降低维护成本,降低修改功能时对其他模块的影响

This commit is contained in:
liuwei
2025-04-03 12:20:55 +08:00
parent f2ec507ff7
commit dbbc16346c
2 changed files with 5 additions and 4 deletions

View File

@@ -3,11 +3,11 @@ from .auth import login_required
import logging
# 创建联系人管理蓝图
contacts_bp = Blueprint('contacts', __name__)
contacts_bp = Blueprint('contacts', __name__, url_prefix='/contacts')
logger = logging.getLogger("ContactsBlueprint")
# 联系人管理页面
@contacts_bp.route('/contacts')
@contacts_bp.route('/')
@login_required
def contacts_management():
"""通讯录管理页面"""
@@ -32,6 +32,7 @@ def api_contacts_all():
return jsonify({"success": False, "error": str(e)}), 500
@contacts_bp.route('/api/statistics', methods=['GET'])
@login_required
def api_contacts_statistics():
"""获取联系人统计信息API"""
try:

View File

@@ -195,7 +195,7 @@
// 根据当前页面路径决定是否显示时间范围选择器
const path = window.location.pathname;
// 只在统计相关页面显示时间范围选择器
this.showTimeRangeSelector = ['/', '/plugins', '/users', '/groups','/robot_management','/errors'].includes(path);
this.showTimeRangeSelector = ['/', '/plugins', '/users', '/groups','/robot','/errors'].includes(path);
},
methods: {
handleSelect(key, keyPath) {
@@ -207,7 +207,7 @@
'3': '/users',
'4': '/groups',
'5': '/errors',
'6': '/robot_management',
'6': '/robot',
'7': '/messages',
'9': '/wx_logs',
'10': '/contacts'