From dc4b1bfce9596784aae881fc448eb83a2480544c Mon Sep 17 00:00:00 2001 From: Nelson <1475262689@qq.com> Date: Fri, 10 Jul 2026 17:13:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=81=A2=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E5=92=8C=E7=9F=AD=E4=BF=A1=E5=80=92?= =?UTF-8?q?=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/user-client/src/components/LoginPanel.vue | 9 ++++++++- ai_knowledge_base_v2/apps/user-client/src/styles.css | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ai_knowledge_base_v2/apps/user-client/src/components/LoginPanel.vue b/ai_knowledge_base_v2/apps/user-client/src/components/LoginPanel.vue index 886ced8..9988b08 100644 --- a/ai_knowledge_base_v2/apps/user-client/src/components/LoginPanel.vue +++ b/ai_knowledge_base_v2/apps/user-client/src/components/LoginPanel.vue @@ -21,6 +21,7 @@ const emit = defineEmits<{ const COUNTDOWN_SECONDS = 60; const COUNTDOWN_PREFIX = "ai-kb-sms-countdown:"; +const PHONE_STORAGE_KEY = "ai-kb-login-phone"; const PHONE_PATTERN = /^1[3-9]\d{9}$/; const phone = ref(""); @@ -56,7 +57,11 @@ const sendButtonText = computed(() => { let countdownTimer: ReturnType | null = null; let toastTimer: ReturnType | null = null; -onMounted(() => restoreCountdown()); +onMounted(() => { + const storedPhone = window.localStorage.getItem(PHONE_STORAGE_KEY) ?? ""; + if (PHONE_PATTERN.test(storedPhone)) phone.value = storedPhone; + restoreCountdown(); +}); onUnmounted(() => { stopCountdownTimer(); if (toastTimer) clearTimeout(toastTimer); @@ -64,6 +69,7 @@ onUnmounted(() => { watch(phone, () => { code.value = sanitizeDigits(code.value, 6); + if (phoneValid.value) window.localStorage.setItem(PHONE_STORAGE_KEY, phone.value); restoreCountdown(); }); @@ -82,6 +88,7 @@ function sanitizeDigits(value: string, maxLength: number) { function clearPhone() { phone.value = ""; phoneTouched.value = false; + window.localStorage.removeItem(PHONE_STORAGE_KEY); } async function sendCode() { diff --git a/ai_knowledge_base_v2/apps/user-client/src/styles.css b/ai_knowledge_base_v2/apps/user-client/src/styles.css index bf65550..1304ec8 100644 --- a/ai_knowledge_base_v2/apps/user-client/src/styles.css +++ b/ai_knowledge_base_v2/apps/user-client/src/styles.css @@ -295,7 +295,7 @@ textarea:focus-visible { padding: 5px 4px; border-radius: 10px; color: var(--login-muted); - font-size: 13px; + font-size: 12px; line-height: 1.7; transition: background 0.18s ease, color 0.18s ease; } @@ -309,13 +309,13 @@ textarea:focus-visible { min-height: 34px; display: inline-flex; align-items: center; - gap: 8px; + gap: 6px; cursor: pointer; } .agreement-toggle input { - width: 20px; - height: 20px; + width: 18px; + height: 18px; margin: 0; accent-color: var(--login-brand-dark); cursor: pointer;