完善验证码逻辑

main
liuyangyi 2024-10-06 14:21:42 +08:00
parent 7158402e0d
commit 40378724b0
1 changed files with 18 additions and 0 deletions

View File

@ -171,6 +171,24 @@ export default {
} }
verificationCodeError.value = ''; // verificationCodeError.value = ''; //
return true; return true;
axios.post('https://api.sso.ycymedu.com/api/syswechat/smslogin', {
phoneNumber: phone.value,
code:verificationCode.value,
redirect_uri:referer.value
})
.then(response => {
if(response.data.code === '200'){
console.log('验证码发送成功:', response.data);
startCountdown(); //
}else{
console.log('验证码发送失败:', response.data);
phoneError.value = response.data.message;
}
})
.catch(error => {
console.error('发送验证码失败:', error);
phoneError.value = '发送验证码失败,请稍后再试';
});
}); });
// //