管理后台 server 使用蓝图模式,降低维护成本,降低修改功能时对其他模块的影响
This commit is contained in:
@@ -3,11 +3,11 @@ from .auth import login_required
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
# 创建联系人管理蓝图
|
# 创建联系人管理蓝图
|
||||||
contacts_bp = Blueprint('contacts', __name__)
|
contacts_bp = Blueprint('contacts', __name__, url_prefix='/contacts')
|
||||||
logger = logging.getLogger("ContactsBlueprint")
|
logger = logging.getLogger("ContactsBlueprint")
|
||||||
|
|
||||||
# 联系人管理页面
|
# 联系人管理页面
|
||||||
@contacts_bp.route('/contacts')
|
@contacts_bp.route('/')
|
||||||
@login_required
|
@login_required
|
||||||
def contacts_management():
|
def contacts_management():
|
||||||
"""通讯录管理页面"""
|
"""通讯录管理页面"""
|
||||||
@@ -32,6 +32,7 @@ def api_contacts_all():
|
|||||||
return jsonify({"success": False, "error": str(e)}), 500
|
return jsonify({"success": False, "error": str(e)}), 500
|
||||||
|
|
||||||
@contacts_bp.route('/api/statistics', methods=['GET'])
|
@contacts_bp.route('/api/statistics', methods=['GET'])
|
||||||
|
@login_required
|
||||||
def api_contacts_statistics():
|
def api_contacts_statistics():
|
||||||
"""获取联系人统计信息API"""
|
"""获取联系人统计信息API"""
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -195,7 +195,7 @@
|
|||||||
// 根据当前页面路径决定是否显示时间范围选择器
|
// 根据当前页面路径决定是否显示时间范围选择器
|
||||||
const path = window.location.pathname;
|
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: {
|
methods: {
|
||||||
handleSelect(key, keyPath) {
|
handleSelect(key, keyPath) {
|
||||||
@@ -207,7 +207,7 @@
|
|||||||
'3': '/users',
|
'3': '/users',
|
||||||
'4': '/groups',
|
'4': '/groups',
|
||||||
'5': '/errors',
|
'5': '/errors',
|
||||||
'6': '/robot_management',
|
'6': '/robot',
|
||||||
'7': '/messages',
|
'7': '/messages',
|
||||||
'9': '/wx_logs',
|
'9': '/wx_logs',
|
||||||
'10': '/contacts'
|
'10': '/contacts'
|
||||||
|
|||||||
Reference in New Issue
Block a user