diff --git a/admin/dashboard/blueprints/contacts.py b/admin/dashboard/blueprints/contacts.py index 9f02b58..ad847ca 100644 --- a/admin/dashboard/blueprints/contacts.py +++ b/admin/dashboard/blueprints/contacts.py @@ -1,4 +1,4 @@ -from flask import Blueprint, render_template, jsonify, request +from flask import Blueprint, render_template, jsonify, request, current_app from .auth import login_required import logging @@ -19,7 +19,7 @@ def contacts_management(): def api_contacts_all(): """获取所有联系人信息API""" try: - server = contacts_bp.server + server = current_app.dashboard_server contacts = server.contact_manager.get_contacts() return jsonify({ "success": True, @@ -59,7 +59,7 @@ def api_contacts_statistics(): def api_contacts_groups(): """获取群组联系人信息API""" try: - server = contacts_bp.server + server = current_app.dashboard_server group_contacts = server.contact_manager.get_group_contacts() return jsonify({ @@ -77,7 +77,7 @@ def api_contacts_groups(): def api_contacts_personal(): """获取个人联系人信息API""" try: - server = contacts_bp.server + server = current_app.dashboard_server personal_contacts = server.contact_manager.get_personal_contacts() return jsonify({ @@ -95,7 +95,7 @@ def api_contacts_personal(): def api_contacts_official(): """获取公众号联系人信息API""" try: - server = contacts_bp.server + server = current_app.dashboard_server official_accounts = server.contact_manager.get_official_accounts() return jsonify({ @@ -113,7 +113,7 @@ def api_contacts_official(): def api_contacts_public(): """获取公共好友信息API""" try: - server = contacts_bp.server + server = current_app.dashboard_server public_contacts = server.contact_manager.get_public_contacts() return jsonify({