From 896a8d3f59bbb06b75d12197db856f1bfe625f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8?= Date: Wed, 20 May 2026 14:14:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=97=AA=E7=83=81=E9=97=AE=E9=A2=98=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E7=A0=81=E6=A1=86=E8=87=AA=E5=8A=A8=E8=81=9A?= =?UTF-8?q?=E7=84=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user/Login.vue | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 293dda5..03b3334 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -40,6 +40,7 @@ (false) // login form 实例 const userStore = useUserStore() const loginFormRef = ref() +const passwordInputRef = ref() const loginForm = ref({ email: '', countryCode: '+86', @@ -167,6 +169,11 @@ const handleLogin = async () => { if (currentTab === 'phone' && loginForm.value.email !== '') { loginForm.value.email = '' } + + // 切换到密码页后自动聚焦密码输入框 + setTimeout(() => { + passwordInputRef.value?.focus() + },400) } // 验证密码+验证码 → 执行登录 else if (currentTab === 'password') { @@ -185,16 +192,6 @@ const handleLogin = async () => { } await userStore.login(loginParams) setStorage('device_no', deviceNo) - activeTab.value = 'email' // 重置tab - hideTab.value = false - loginForm.value = { - // 清空表单 - email: '', - countryCode: '+86', - phone: '', - password: '', - code: '', - } } } catch (error) { console.error('表单校验失败:', error)