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;