diff --git a/desktop/src/features/auth/LoginView.vue b/desktop/src/features/auth/LoginView.vue index cdb5b73..3adacdb 100644 --- a/desktop/src/features/auth/LoginView.vue +++ b/desktop/src/features/auth/LoginView.vue @@ -118,6 +118,15 @@ async function useSaved() { } } +async function backFromSms() { + smsRequired.value = false; + stopCountdown(); + smsCode.value = ""; + smsHint.value = ""; + errorText.value = ""; + await reloadCaptcha(); +} + async function requestSms() { if (!sessionId.value || countdown.value > 0 || sending.value) return; sending.value = true; @@ -153,6 +162,14 @@ async function submit(smsCodeText = "") { smsHint.value = ""; return; } + if (result.status === "need_captcha") { + smsRequired.value = false; + stopCountdown(); + smsCode.value = ""; + errorText.value = result.message || ""; + await reloadCaptcha(true); + return; + } if (result.user) { smsRequired.value = false; stopCountdown(); @@ -238,6 +255,7 @@ onUnmounted(stopCountdown);

{{ smsHint }}

+ 返回 {{ countdown > 0 ? `重新发送(${countdown})` : "发送验证码" }} diff --git a/desktop/src/styles.css b/desktop/src/styles.css index b91fced..7b082e2 100644 --- a/desktop/src/styles.css +++ b/desktop/src/styles.css @@ -164,6 +164,10 @@ select { margin-top: 16px; } +.sms-back { + margin-right: auto; +} + .shell { height: 100%; display: grid;