fix: 修复验证码不校验手机号输入的bug & 将验证码改为6位
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user