修改注册界面
This commit is contained in:
parent
89559e2e83
commit
e654306e8d
|
@ -91,7 +91,7 @@
|
|||
</el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="phoneCooldown > 0"
|
||||
:disabled="phoneCooldown > 0 || !registerForm.phone"
|
||||
@click="sendPhoneCode"
|
||||
>
|
||||
{{ phoneCooldown > 0 ? `${phoneCooldown}s` : '获取验证码' }}
|
||||
|
@ -297,7 +297,17 @@ const startEmailCooldown = () => {
|
|||
|
||||
// 发送手机验证码
|
||||
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('手机验证码已发送')
|
||||
startPhoneCooldown()
|
||||
|
|
Loading…
Reference in New Issue