调整通讯录管理
This commit is contained in:
@@ -175,6 +175,7 @@ class DashboardServer:
|
||||
@login_required
|
||||
def wx_logs():
|
||||
return render_template('wx_logs.html')
|
||||
|
||||
# 在_create_app方法中添加新的路由
|
||||
@app.route('/robot_management')
|
||||
@login_required
|
||||
@@ -205,24 +206,6 @@ class DashboardServer:
|
||||
self.logger.error(f"获取所有联系人信息失败: {e}")
|
||||
return jsonify({"success": False, "error": str(e)}), 500
|
||||
|
||||
@app.route('/api/contacts/groups', methods=['GET'])
|
||||
@login_required
|
||||
def api_contacts_groups():
|
||||
"""获取群组联系人信息API"""
|
||||
try:
|
||||
contacts = self.contact_manager.get_contacts()
|
||||
group_contacts = {wxid: name for wxid, name in contacts.items() if '@@' in wxid or '@chatroom' in wxid}
|
||||
|
||||
return jsonify({
|
||||
"success": True,
|
||||
"data": {
|
||||
"groups": group_contacts
|
||||
}
|
||||
})
|
||||
except Exception as e:
|
||||
self.logger.error(f"获取群组联系人信息失败: {e}")
|
||||
return jsonify({"success": False, "error": str(e)}), 500
|
||||
|
||||
@app.route('/api/contacts/personal', methods=['GET'])
|
||||
@login_required
|
||||
def api_contacts_personal():
|
||||
@@ -230,7 +213,7 @@ class DashboardServer:
|
||||
try:
|
||||
contacts = self.contact_manager.get_contacts()
|
||||
personal_contacts = {wxid: name for wxid, name in contacts.items()
|
||||
if '@@' not in wxid and '@chatroom' not in wxid}
|
||||
if '@@' not in wxid and '@chatroom' not in wxid}
|
||||
|
||||
return jsonify({
|
||||
"success": True,
|
||||
@@ -729,7 +712,6 @@ class DashboardServer:
|
||||
self.logger.error(f"获取群组列表失败: {e}")
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
@app.route('/api/wx_logs')
|
||||
@login_required
|
||||
def api_wx_logs():
|
||||
|
||||
Reference in New Issue
Block a user