From 598098c2ed81db4f65f3c161743341e4af2c5865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:12:08 +0800 Subject: [PATCH] feat: Login page username automatically obtains focus (#10228) --- frontend/src/views/login/components/login-form.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index aa11b43c5..6945386d8 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -80,6 +80,7 @@ size="large" name="username" autocomplete="username" + ref="userNameRef" > @@ -253,6 +254,7 @@ function checkAgreeLicense(rule: any, value: any, callback: any) { } let isLoggingIn = false; +const userNameRef = ref(); const mfaLoginRef = ref(); const mfaButtonFocused = ref(); const mfaLoginForm = reactive({ @@ -489,7 +491,9 @@ onMounted(() => { '--login-loading-mask-color', adjustColorToRGBA(loginBtnLinkColor.value, 30, 15), ); - + nextTick(() => { + userNameRef.value?.focus(); + }); loginForm.agreeLicense = globalStore.agreeLicense; document.onkeydown = (e: any) => { e = window.event || e;