修改注册界面

This commit is contained in:
ovo 2024-12-05 22:40:59 +08:00
parent 89559e2e83
commit e654306e8d
1 changed files with 12 additions and 2 deletions

View File

@ -91,7 +91,7 @@
</el-input> </el-input>
<el-button <el-button
type="primary" type="primary"
:disabled="phoneCooldown > 0" :disabled="phoneCooldown > 0 || !registerForm.phone"
@click="sendPhoneCode" @click="sendPhoneCode"
> >
{{ phoneCooldown > 0 ? `${phoneCooldown}s` : '获取验证码' }} {{ phoneCooldown > 0 ? `${phoneCooldown}s` : '获取验证码' }}
@ -297,7 +297,17 @@ const startEmailCooldown = () => {
// //
const sendPhoneCode = () => { const sendPhoneCode = () => {
if (phoneCooldown.value > 0) return if (phoneCooldown.value > 0 || !registerForm.phone) {
ElMessage.warning('请先输入手机号')
return
}
//
if (!/^1[3-9]\d{9}$/.test(registerForm.phone)) {
ElMessage.warning('请输入正确的手机号')
return
}
// //
ElMessage.success('手机验证码已发送') ElMessage.success('手机验证码已发送')
startPhoneCooldown() startPhoneCooldown()