From a63656736684db385765ab4a07de16dd9ea855b6 Mon Sep 17 00:00:00 2001 From: lzh Date: Fri, 19 Dec 2025 11:45:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E4=B8=8D=E6=A0=A1=E9=AA=8C=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E7=9A=84bug=20&=20=E5=B0=86=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E6=94=B9=E4=B8=BA6=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/_core/authentication/code-login.vue | 2 +- .../src/views/_core/authentication/forget-password.vue | 2 +- .../ui-kit/shadcn-ui/src/components/pin-input/input.vue | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/web-antd/src/views/_core/authentication/code-login.vue b/apps/web-antd/src/views/_core/authentication/code-login.vue index 1862abf8c..98d75b47c 100644 --- a/apps/web-antd/src/views/_core/authentication/code-login.vue +++ b/apps/web-antd/src/views/_core/authentication/code-login.vue @@ -24,7 +24,7 @@ const accessStore = useAccessStore(); const tenantEnable = isTenantEnable(); const loading = ref(false); -const CODE_LENGTH = 4; +const CODE_LENGTH = 6; const loginRef = ref(); diff --git a/apps/web-antd/src/views/_core/authentication/forget-password.vue b/apps/web-antd/src/views/_core/authentication/forget-password.vue index 4837cf7dc..4534b18d6 100644 --- a/apps/web-antd/src/views/_core/authentication/forget-password.vue +++ b/apps/web-antd/src/views/_core/authentication/forget-password.vue @@ -24,7 +24,7 @@ const router = useRouter(); const tenantEnable = isTenantEnable(); const loading = ref(false); -const CODE_LENGTH = 4; +const CODE_LENGTH = 6; const forgetPasswordRef = ref(); /** 获取租户列表,并默认选中 */ diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue b/packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue index a8557788d..595b7275b 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue @@ -59,12 +59,16 @@ function handleComplete(e: string[]) { async function handleSend(e: Event) { try { e?.preventDefault(); + // 先执行验证码发送逻辑(包含手机号验证) + await handleSendCode(); + // 只有成功后才开始倒计时 countdown.value = maxTime; startCountdown(); - await handleSendCode(); } catch (error) { console.error('Failed to send code:', error); - // Consider emitting an error event or showing a notification + // 如果发送失败,确保倒计时停止 + countdown.value = 0; + clearTimeout(timer.value); emit('sendError', error); } }