fix: 修复验证码不校验手机号输入的bug & 将验证码改为6位

This commit is contained in:
lzh
2025-12-19 11:45:58 +08:00
parent ececf4cdae
commit a636567366
3 changed files with 8 additions and 4 deletions

View File

@@ -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);
}
}