From 19b2492c42ae9f909a206ef69c9dfdbcf8841fb8 Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 7 May 2026 14:41:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E7=99=BB=E5=BD=95=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=B9=B6=E6=98=8E=E7=A1=AE864=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/dashboard/templates/index.html | 135 -------------------- robot.py | 30 +---- wechat_ipad/providers/server_864/runtime.py | 6 +- 3 files changed, 7 insertions(+), 164 deletions(-) diff --git a/admin/dashboard/templates/index.html b/admin/dashboard/templates/index.html index bc07417..8522caa 100644 --- a/admin/dashboard/templates/index.html +++ b/admin/dashboard/templates/index.html @@ -192,33 +192,6 @@ - -
- - -
@@ -2094,111 +2067,6 @@ margin-top: 16px; } - .login-qr-history { - padding: 18px; - border-radius: 22px; - border: 1px solid rgba(148, 163, 184, 0.14); - background: rgba(248, 250, 252, 0.68); - } - - .login-qr-history__head { - margin-bottom: 14px; - } - - .login-qr-history__head h4 { - font-size: 16px; - color: #0f172a; - margin-bottom: 6px; - } - - .login-qr-history__head p { - font-size: 13px; - color: #64748b; - } - - .login-qr-history__grid { - display: grid; - grid-template-columns: repeat(3, minmax(0, 1fr)); - gap: 14px; - } - - .login-qr-history__card { - padding: 12px; - border-radius: 18px; - background: rgba(255,255,255,0.92); - border: 1px solid rgba(148, 163, 184, 0.12); - } - - .login-qr-history__card--active { - box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.22); - } - - .login-qr-history__thumb { - width: 100%; - aspect-ratio: 1 / 1; - border-radius: 14px; - overflow: hidden; - background: #fff; - border: 1px solid rgba(148, 163, 184, 0.10); - margin-bottom: 10px; - } - - .login-qr-history__thumb img { - width: 100%; - height: 100%; - object-fit: contain; - } - - .login-qr-history__thumb-empty { - width: 100%; - height: 100%; - display: flex; - align-items: center; - justify-content: center; - font-size: 12px; - color: #94a3b8; - } - - .login-qr-history__status { - display: flex; - align-items: center; - gap: 8px; - font-size: 12px; - color: #334155; - margin-bottom: 8px; - } - - .login-qr-history__status-dot { - width: 8px; - height: 8px; - border-radius: 50%; - background: #cbd5e1; - flex-shrink: 0; - } - - .login-qr-history__status-dot--healthy { - background: #10b981; - } - - .login-qr-history__status-dot--warning { - background: #f59e0b; - } - - .login-qr-history__status-dot--danger { - background: #ef4444; - } - - .login-qr-history__status-dot--soft { - background: #94a3b8; - } - - .login-qr-history__text { - font-size: 12px; - color: #64748b; - line-height: 1.6; - word-break: break-all; - } - .health-overview-card .el-card__body { padding: 20px !important; } @@ -2938,9 +2806,6 @@ grid-template-columns: 1fr; } - .login-qr-history__grid { - grid-template-columns: 1fr; - } } @media (max-width: 768px) { diff --git a/robot.py b/robot.py index 582a853..90978f2 100644 --- a/robot.py +++ b/robot.py @@ -572,23 +572,6 @@ class Robot: current_record["expires_at"] = now_ts + expires_in with self._ipad_login_qr_lock: - history_records = list(self.ipad_login_qr_state.get("history", []) or []) - # 二维码历史只在“uuid 发生变化”时追加一条: - # 1. 倒计时刷新会非常频繁,如果每次都入历史,前端会被大量重复记录淹没; - # 2. 这里把历史理解为“最近几次生成过哪些二维码”,而不是每一秒状态快照; - # 3. 这样首页既能展示多个二维码记录,也能保持列表简洁可读。 - if uuid_value: - existing_index = next( - (index for index, item in enumerate(history_records) if str(item.get("uuid", "") or "") == uuid_value), - -1, - ) - history_entry = dict(current_record) - if existing_index >= 0: - history_records[existing_index] = history_entry - else: - history_records.insert(0, history_entry) - history_records = history_records[:3] - self.ipad_login_qr_state = { "logged_in": False, "active": status != "confirmed", @@ -599,7 +582,7 @@ class Robot: "login_required": login_required, "status_text": status_text, "current": current_record, - "history": history_records, + "history": [], "updated_at": now_ts, } @@ -618,15 +601,6 @@ class Robot: login_required = bool((payload or {}).get("login_required", False)) with self._ipad_login_qr_lock: - history_records = list(self.ipad_login_qr_state.get("history", []) or []) - if cleared_uuid: - for item in history_records: - if str(item.get("uuid", "") or "") == cleared_uuid: - item["status"] = status - item["status_text"] = status_text - item["updated_at"] = now_ts - item["updated_at_text"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(now_ts)) - self.ipad_login_qr_state = { "logged_in": status in {"confirmed", "logged_in"} or bool(self.wxid), "active": False, @@ -637,7 +611,7 @@ class Robot: "login_required": login_required, "status_text": status_text, "current": {}, - "history": history_records[:3], + "history": [], "updated_at": now_ts, } diff --git a/wechat_ipad/providers/server_864/runtime.py b/wechat_ipad/providers/server_864/runtime.py index c039efa..6a83b00 100644 --- a/wechat_ipad/providers/server_864/runtime.py +++ b/wechat_ipad/providers/server_864/runtime.py @@ -175,7 +175,11 @@ class Server864RuntimeMixin: on_login_qr_cleared, { "status": "confirmed", - "status_text": "扫码登录成功", + # 864 进入 `state=2` 后,已经拿到了 wxid / wxnewpass 等关键登录信息: + # 1. 这说明扫码本身已经成功,不需要用户继续执行额外扫码动作; + # 2. 这里把提示文案改得更明确,减少“是不是还要继续点验证链接”的疑惑; + # 3. 后续若服务端初始化还要几秒,也归入“服务端完成登录”阶段,而不是继续归咎给扫码步骤。 + "status_text": "扫码成功,等待服务端完成登录", "uuid": uuid, "provider_name": "server_864", "provider_stage": "logged_in",