From e49a94f1812341df76eeff3135cbe9fedb1b1898 Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 2 Apr 2025 11:25:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=90=E8=A1=8C=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/dashboard/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/dashboard/server.py b/admin/dashboard/server.py index 6d582ea..ef87dca 100644 --- a/admin/dashboard/server.py +++ b/admin/dashboard/server.py @@ -574,7 +574,7 @@ class DashboardServer: return jsonify({'error': str(e)}), 500 - @app.route('/api_wx_logs') + @app.route('/api/wx_logs') @login_required def api_wx_logs(): try: @@ -591,6 +591,7 @@ class DashboardServer: # 读取日志文件 log_content = [] if os.path.exists(log_file): + from collections import deque # 添加这一行导入deque with open(log_file, 'r', encoding='utf-8', errors='ignore') as f: # 使用deque获取最后N行 log_content = list(deque(f, lines))