精简登录弹窗并明确864扫码成功提示

This commit is contained in:
liuwei
2026-05-07 14:41:34 +08:00
parent 296d9484db
commit 19b2492c42
3 changed files with 7 additions and 164 deletions

View File

@@ -192,33 +192,6 @@
</div>
</div>
</div>
<div v-if="loginQrDialog.history.length" class="login-qr-history">
<div class="login-qr-history__head">
<h4>最近二维码记录</h4>
<p>保留最近几次二维码,方便确认是否已经刷新到新码。</p>
</div>
<div class="login-qr-history__grid">
<div
v-for="item in loginQrDialog.history"
:key="item.uuid || item.updated_at"
class="login-qr-history__card"
:class="item.uuid === loginQrCurrent.uuid ? 'login-qr-history__card--active' : ''">
<div class="login-qr-history__thumb">
<img v-if="item.image_data" :src="item.image_data" alt="历史二维码" />
<div v-else class="login-qr-history__thumb-empty">暂无预览</div>
</div>
<div class="login-qr-history__info">
<div class="login-qr-history__status">
<span class="login-qr-history__status-dot" :class="`login-qr-history__status-dot--${mapLoginQrTone(item.status)}`"></span>
<span>{% raw %}{{ item.status_text || '等待扫码登录' }}{% endraw %}</span>
</div>
<div class="login-qr-history__text">UUID: {% raw %}{{ item.uuid || '-' }}{% endraw %}</div>
<div class="login-qr-history__text">时间: {% raw %}{{ item.updated_at_text || '-' }}{% endraw %}</div>
</div>
</div>
</div>
</div>
</div>
</el-dialog>
@@ -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) {

View File

@@ -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,
}

View File

@@ -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",