From 296d9484dbf36cdc5394ffa262ac45334765c851 Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 7 May 2026 14:36:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA864=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=BF=87=E7=A8=8B=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/dashboard/templates/index.html | 88 ++++++++++++++++++++- wechat_ipad/providers/server_864/runtime.py | 9 +++ 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/admin/dashboard/templates/index.html b/admin/dashboard/templates/index.html index 773317b..bc07417 100644 --- a/admin/dashboard/templates/index.html +++ b/admin/dashboard/templates/index.html @@ -154,11 +154,25 @@ 二维码有效期 {% raw %}{{ loginQrCountdownText }}{% endraw %} +
+ + +
+ @@ -661,6 +678,9 @@ if (this.loginQrDialog.provider_stage === 'login_required') { return '需要重新登录'; } + if (this.loginQrDialog.provider_stage === 'scan_confirmed') { + return '已扫码待确认'; + } if (this.loginQrDialog.provider_stage === 'verification_required') { return '等待安全验证'; } @@ -672,6 +692,9 @@ if (this.loginQrDialog.provider_stage === 'connection_pending') { return '864 服务端准备中'; } + if (this.loginQrDialog.provider_stage === 'scan_confirmed') { + return '864 扫码确认中'; + } if (this.loginQrDialog.provider_stage === 'verification_required') { return '864 二次验证'; } @@ -696,6 +719,9 @@ if (this.loginQrDialog.provider_stage === 'connection_pending') { return '等待服务端准备'; } + if (this.loginQrDialog.provider_stage === 'scan_confirmed') { + return '已扫码,等待服务端确认'; + } if (this.loginQrDialog.provider_stage === 'verification_required') { return '等待打开验证链接'; } @@ -955,6 +981,16 @@ } window.open(verificationUrl, '_blank', 'noopener'); }, + formatLoginQrRawState(rawState) { + const normalized = Number(rawState || 0); + const labelMap = { + 0: '0 等待扫码', + 1: '1 已扫码待确认', + 2: '2 登录完成', + 4: '4 终态/已失效' + }; + return labelMap[normalized] || `${normalized || 0} 未知状态`; + }, fallbackCopyLoginQrScanUrl(scanUrl) { const textarea = document.createElement('textarea'); textarea.value = scanUrl; @@ -1973,6 +2009,56 @@ letter-spacing: 0.06em; } + .login-qr-dialog__account { + display: flex; + align-items: center; + gap: 14px; + padding: 14px 16px; + border-radius: 18px; + background: rgba(255, 255, 255, 0.92); + border: 1px solid rgba(148, 163, 184, 0.14); + margin-bottom: 16px; + } + + .login-qr-dialog__account-avatar { + width: 48px; + height: 48px; + border-radius: 16px; + overflow: hidden; + background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(14, 165, 233, 0.12)); + color: #1d4ed8; + display: flex; + align-items: center; + justify-content: center; + font-size: 18px; + font-weight: 700; + flex-shrink: 0; + } + + .login-qr-dialog__account-avatar img { + width: 100%; + height: 100%; + object-fit: cover; + } + + .login-qr-dialog__account-info { + min-width: 0; + display: flex; + flex-direction: column; + gap: 4px; + } + + .login-qr-dialog__account-label { + font-size: 12px; + color: #64748b; + } + + .login-qr-dialog__account-info strong { + font-size: 15px; + color: #0f172a; + word-break: break-all; + } + .login-qr-dialog__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); diff --git a/wechat_ipad/providers/server_864/runtime.py b/wechat_ipad/providers/server_864/runtime.py index 8b0dcc3..c039efa 100644 --- a/wechat_ipad/providers/server_864/runtime.py +++ b/wechat_ipad/providers/server_864/runtime.py @@ -214,6 +214,15 @@ class Server864RuntimeMixin: status_text = "安全验证链路已结束,但服务端未完成登录收口,正在准备刷新二维码" else: status_text = raw_status_text or "二维码状态已结束,正在准备刷新二维码" + elif raw_state == 1: + # 864 在 `state=1` 时通常已经识别出扫码账号,但还没推进到最终登录完成: + # 1. 这时接口经常会同时回传昵称、头像以及 VerificationUrl; + # 2. 但从用户体验上看,它更接近“已扫码,等待服务端确认”,不应该继续只提示去点链接; + # 3. 因此这里单独映射成可读阶段,方便 Dashboard 展示更准确的过程状态。 + provider_stage = "scan_confirmed" + status = "waiting" + display_name = nick_name or "当前微信账号" + status_text = raw_status_text or f"已扫码:{display_name},等待服务端确认登录" elif verification_url: provider_stage = "verification_required" status = "waiting"