增强864登录过程状态展示
This commit is contained in:
@@ -154,11 +154,25 @@
|
|||||||
<span class="login-qr-dialog__countdown-label">二维码有效期</span>
|
<span class="login-qr-dialog__countdown-label">二维码有效期</span>
|
||||||
<span class="login-qr-dialog__countdown-value">{% raw %}{{ loginQrCountdownText }}{% endraw %}</span>
|
<span class="login-qr-dialog__countdown-value">{% raw %}{{ loginQrCountdownText }}{% endraw %}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="loginQrCurrent.nick_name || loginQrCurrent.head_img_url" class="login-qr-dialog__account">
|
||||||
|
<div class="login-qr-dialog__account-avatar">
|
||||||
|
<img v-if="loginQrCurrent.head_img_url" :src="loginQrCurrent.head_img_url" alt="扫码账号头像" />
|
||||||
|
<span v-else>{% raw %}{{ (loginQrCurrent.nick_name || '?').slice(0, 1) }}{% endraw %}</span>
|
||||||
|
</div>
|
||||||
|
<div class="login-qr-dialog__account-info">
|
||||||
|
<span class="login-qr-dialog__account-label">当前扫码账号</span>
|
||||||
|
<strong>{% raw %}{{ loginQrCurrent.nick_name || '已识别微信账号' }}{% endraw %}</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="login-qr-dialog__meta">
|
<div class="login-qr-dialog__meta">
|
||||||
<div class="login-qr-dialog__meta-item">
|
<div class="login-qr-dialog__meta-item">
|
||||||
<span>UUID</span>
|
<span>UUID</span>
|
||||||
<strong>{% raw %}{{ loginQrCurrent.uuid || '-' }}{% endraw %}</strong>
|
<strong>{% raw %}{{ loginQrCurrent.uuid || '-' }}{% endraw %}</strong>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="login-qr-dialog__meta-item">
|
||||||
|
<span>原始状态</span>
|
||||||
|
<strong>{% raw %}{{ formatLoginQrRawState(loginQrCurrent.raw_state) }}{% endraw %}</strong>
|
||||||
|
</div>
|
||||||
<div class="login-qr-dialog__meta-item">
|
<div class="login-qr-dialog__meta-item">
|
||||||
<span>最近刷新</span>
|
<span>最近刷新</span>
|
||||||
<strong>{% raw %}{{ loginQrCurrent.updated_at_text || '-' }}{% endraw %}</strong>
|
<strong>{% raw %}{{ loginQrCurrent.updated_at_text || '-' }}{% endraw %}</strong>
|
||||||
@@ -169,7 +183,10 @@
|
|||||||
<el-button v-if="loginQrCurrent.scan_url" type="text" @click="copyLoginQrScanUrl">
|
<el-button v-if="loginQrCurrent.scan_url" type="text" @click="copyLoginQrScanUrl">
|
||||||
复制扫码链接
|
复制扫码链接
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="loginQrCurrent.verification_url" type="text" @click="openLoginQrVerificationUrl">
|
<el-button
|
||||||
|
v-if="loginQrCurrent.verification_url && loginQrDialog.provider_stage === 'verification_required'"
|
||||||
|
type="text"
|
||||||
|
@click="openLoginQrVerificationUrl">
|
||||||
打开安全验证链接
|
打开安全验证链接
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -661,6 +678,9 @@
|
|||||||
if (this.loginQrDialog.provider_stage === 'login_required') {
|
if (this.loginQrDialog.provider_stage === 'login_required') {
|
||||||
return '需要重新登录';
|
return '需要重新登录';
|
||||||
}
|
}
|
||||||
|
if (this.loginQrDialog.provider_stage === 'scan_confirmed') {
|
||||||
|
return '已扫码待确认';
|
||||||
|
}
|
||||||
if (this.loginQrDialog.provider_stage === 'verification_required') {
|
if (this.loginQrDialog.provider_stage === 'verification_required') {
|
||||||
return '等待安全验证';
|
return '等待安全验证';
|
||||||
}
|
}
|
||||||
@@ -672,6 +692,9 @@
|
|||||||
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
||||||
return '864 服务端准备中';
|
return '864 服务端准备中';
|
||||||
}
|
}
|
||||||
|
if (this.loginQrDialog.provider_stage === 'scan_confirmed') {
|
||||||
|
return '864 扫码确认中';
|
||||||
|
}
|
||||||
if (this.loginQrDialog.provider_stage === 'verification_required') {
|
if (this.loginQrDialog.provider_stage === 'verification_required') {
|
||||||
return '864 二次验证';
|
return '864 二次验证';
|
||||||
}
|
}
|
||||||
@@ -696,6 +719,9 @@
|
|||||||
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
||||||
return '等待服务端准备';
|
return '等待服务端准备';
|
||||||
}
|
}
|
||||||
|
if (this.loginQrDialog.provider_stage === 'scan_confirmed') {
|
||||||
|
return '已扫码,等待服务端确认';
|
||||||
|
}
|
||||||
if (this.loginQrDialog.provider_stage === 'verification_required') {
|
if (this.loginQrDialog.provider_stage === 'verification_required') {
|
||||||
return '等待打开验证链接';
|
return '等待打开验证链接';
|
||||||
}
|
}
|
||||||
@@ -955,6 +981,16 @@
|
|||||||
}
|
}
|
||||||
window.open(verificationUrl, '_blank', 'noopener');
|
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) {
|
fallbackCopyLoginQrScanUrl(scanUrl) {
|
||||||
const textarea = document.createElement('textarea');
|
const textarea = document.createElement('textarea');
|
||||||
textarea.value = scanUrl;
|
textarea.value = scanUrl;
|
||||||
@@ -1973,6 +2009,56 @@
|
|||||||
letter-spacing: 0.06em;
|
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 {
|
.login-qr-dialog__meta {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
|||||||
@@ -214,6 +214,15 @@ class Server864RuntimeMixin:
|
|||||||
status_text = "安全验证链路已结束,但服务端未完成登录收口,正在准备刷新二维码"
|
status_text = "安全验证链路已结束,但服务端未完成登录收口,正在准备刷新二维码"
|
||||||
else:
|
else:
|
||||||
status_text = raw_status_text or "二维码状态已结束,正在准备刷新二维码"
|
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:
|
elif verification_url:
|
||||||
provider_stage = "verification_required"
|
provider_stage = "verification_required"
|
||||||
status = "waiting"
|
status = "waiting"
|
||||||
|
|||||||
Reference in New Issue
Block a user