优化864登录三态展示并更新适配路线文档
This commit is contained in:
@@ -20,6 +20,10 @@ def _serialize_login_qr_state(server) -> dict:
|
||||
"logged_in": False,
|
||||
"active": False,
|
||||
"status": "unavailable",
|
||||
"provider_name": "",
|
||||
"provider_stage": "status_unavailable",
|
||||
"connection_ready": False,
|
||||
"login_required": False,
|
||||
"status_text": "机器人运行态暂不可用",
|
||||
"current": {},
|
||||
"history": [],
|
||||
@@ -31,6 +35,10 @@ def _serialize_login_qr_state(server) -> dict:
|
||||
"logged_in": bool(state.get("logged_in", False)),
|
||||
"active": bool(state.get("active", False)),
|
||||
"status": str(state.get("status", "idle") or "idle"),
|
||||
"provider_name": str(state.get("provider_name", "") or ""),
|
||||
"provider_stage": str(state.get("provider_stage", "bootstrap") or "bootstrap"),
|
||||
"connection_ready": bool(state.get("connection_ready", False)),
|
||||
"login_required": bool(state.get("login_required", False)),
|
||||
"status_text": str(state.get("status_text", "尚未进入扫码登录流程") or "尚未进入扫码登录流程"),
|
||||
"runtime_running": bool(state.get("runtime_running", False)),
|
||||
"wxid": str(state.get("wxid", "") or ""),
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<template slot="title">
|
||||
<div class="login-qr-banner__content">
|
||||
<div>
|
||||
<div class="login-qr-banner__title">当前微信未登录,首页已进入扫码引导模式</div>
|
||||
<div class="login-qr-banner__title">{% raw %}{{ loginQrBannerTitle }}{% endraw %}</div>
|
||||
<div class="login-qr-banner__desc">
|
||||
{% raw %}{{ loginQrDialog.status_text || '请使用手机微信扫码登录当前环境。' }}{% endraw %}
|
||||
</div>
|
||||
@@ -575,6 +575,10 @@
|
||||
logged_in: false,
|
||||
active: false,
|
||||
status: 'idle',
|
||||
provider_name: '',
|
||||
provider_stage: 'bootstrap',
|
||||
connection_ready: false,
|
||||
login_required: false,
|
||||
status_text: '尚未进入扫码登录流程',
|
||||
current: {},
|
||||
history: [],
|
||||
@@ -622,8 +626,23 @@
|
||||
return !this.loginQrDialog.logged_in;
|
||||
},
|
||||
loginQrStatusTone() {
|
||||
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
||||
return 'soft';
|
||||
}
|
||||
if (this.loginQrDialog.provider_stage === 'login_required') {
|
||||
return 'danger';
|
||||
}
|
||||
return this.mapLoginQrTone(this.loginQrDialog.status);
|
||||
},
|
||||
loginQrBannerTitle() {
|
||||
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
||||
return '当前 864 服务连接尚未建立,首页已进入登录准备模式';
|
||||
}
|
||||
if (this.loginQrDialog.provider_stage === 'login_required') {
|
||||
return '当前微信登录态已失效,首页已进入重新登录模式';
|
||||
}
|
||||
return '当前微信未登录,首页已进入扫码引导模式';
|
||||
},
|
||||
loginQrStatusText() {
|
||||
const toneMap = {
|
||||
waiting: '等待扫码',
|
||||
@@ -633,9 +652,22 @@
|
||||
idle: '等待登录流程',
|
||||
unavailable: '状态暂不可用'
|
||||
};
|
||||
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
||||
return '等待建立连接';
|
||||
}
|
||||
if (this.loginQrDialog.provider_stage === 'login_required') {
|
||||
return '需要重新登录';
|
||||
}
|
||||
return toneMap[this.loginQrDialog.status] || '等待登录流程';
|
||||
},
|
||||
loginQrSourceText() {
|
||||
const providerName = String(this.loginQrDialog.provider_name || '').toLowerCase();
|
||||
if (providerName === 'server_864' || providerName === '864') {
|
||||
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
||||
return '864 服务端准备中';
|
||||
}
|
||||
return '864 服务端登录';
|
||||
}
|
||||
const source = this.loginQrCurrent.login_source;
|
||||
if (source === 'awaken') {
|
||||
return '缓存唤醒登录';
|
||||
@@ -652,6 +684,12 @@
|
||||
if (this.loginQrDialog.status === 'expired') {
|
||||
return '已过期,等待刷新';
|
||||
}
|
||||
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
||||
return '等待服务端准备';
|
||||
}
|
||||
if (this.loginQrDialog.provider_stage === 'login_required' && !this.loginQrCurrent.uuid) {
|
||||
return '等待新二维码';
|
||||
}
|
||||
if (!this.loginQrCurrent.uuid) {
|
||||
return '等待生成';
|
||||
}
|
||||
@@ -866,6 +904,10 @@
|
||||
this.loginQrCountdownSeconds = 0;
|
||||
return;
|
||||
}
|
||||
if (this.loginQrDialog.provider_stage === 'connection_pending') {
|
||||
this.loginQrCountdownSeconds = 0;
|
||||
return;
|
||||
}
|
||||
if (this.loginQrCountdownSeconds > 0) {
|
||||
this.loginQrCountdownSeconds -= 1;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user