mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-11 21:42:09 +08:00
fix: 修复验证码登录发送逻辑,未校验手机号或发送失败仍开始倒计时的问题 (#7616)
This commit is contained in:
@@ -40,6 +40,10 @@ const formSchema = computed((): VbenFormSchema[] => {
|
||||
return text;
|
||||
},
|
||||
placeholder: $t('authentication.code'),
|
||||
handleSendCode: async () => {
|
||||
console.warn('发送验证码前校验等逻辑');
|
||||
throw new Error('手机号校验失败');
|
||||
},
|
||||
},
|
||||
fieldName: 'code',
|
||||
label: $t('authentication.code'),
|
||||
|
||||
@@ -59,9 +59,9 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user