From 79e2c48e021921921a6f5357c9bddb8973009e2c Mon Sep 17 00:00:00 2001 From: Nixevol Date: Sun, 25 Oct 2026 07:01:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=90=8E=E5=8F=AF=E4=BB=A5=E9=87=8D=E8=AF=95=E5=B9=B6=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=8E=B7=E5=8F=96=E9=AA=8C=E8=AF=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desktop/src/features/auth/LoginView.vue | 22 ++++++++++++++++++++-- desktop/src/styles.css | 7 +++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/desktop/src/features/auth/LoginView.vue b/desktop/src/features/auth/LoginView.vue index 3adacdb..6460994 100644 --- a/desktop/src/features/auth/LoginView.vue +++ b/desktop/src/features/auth/LoginView.vue @@ -10,6 +10,8 @@ defineProps<{ notice?: string }>(); const emit = defineEmits<{ success: [user: UserInfo] }>(); const ready = ref(false); +const connecting = ref(false); +const connectFailed = ref(false); const offline = ref(""); const sessionId = ref(""); const captchaUrl = ref(""); @@ -47,6 +49,8 @@ async function refreshSaved() { } async function connect() { + connecting.value = true; + connectFailed.value = false; offline.value = ""; ready.value = false; for (let attempt = 0; attempt < 40; attempt += 1) { @@ -55,17 +59,24 @@ async function connect() { sessionId.value = result.sessionId; captchaUrl.value = result.captcha; ready.value = true; + connecting.value = false; + offline.value = ""; return; } catch (error) { const failedLocally = !(error instanceof ApiError) || error.status === 0; offline.value = error instanceof ApiError ? error.message : "连接失败"; if (!failedLocally) { ready.value = true; + connecting.value = false; return; } await new Promise((resolve) => window.setTimeout(resolve, 500)); } } + connecting.value = false; + connectFailed.value = true; + ready.value = false; + offline.value = "连接失败"; } async function reloadCaptcha(keepError = false) { @@ -205,8 +216,14 @@ onUnmounted(stopCountdown); {{ notice }} - - 连接失败,正在重试。 + + 连接失败,正在重试。 + {{ offline }} {{ errorText }}
@@ -242,6 +259,7 @@ onUnmounted(stopCountdown);
验证码 + 重新获取验证码
diff --git a/desktop/src/styles.css b/desktop/src/styles.css index 7b082e2..b19a2ad 100644 --- a/desktop/src/styles.css +++ b/desktop/src/styles.css @@ -168,6 +168,13 @@ select { margin-right: auto; } +.retry-row { + display: flex; + justify-content: flex-end; + gap: 8px; + margin-bottom: 12px; +} + .shell { height: 100%; display: grid;