提交 82cb76c7 编写于 作者: tao.wu's avatar tao.wu

增加手机号校验逻辑

上级 4f1be858
......@@ -131,7 +131,7 @@
const { regMobile, mobilePhone, authCode, id, taskId, activityId } = this;
const mobileTrue = regMobile.test(mobilePhone);
if(this.mobilePhone=='' || this.mobilePhone.length!=11 || !mobileTrue){
if(!mobileTrue){
this.$toast('请输入正确的手机号');
return;
}
......@@ -174,7 +174,9 @@
},
// 发送获取短信验证码
sendSms(){
if(this.mobilePhone=='' || this.mobilePhone.length!=11){
const { regMobile, mobilePhone, flag, captchaToken, captchaAnswer } = this;
const mobileTrue = regMobile.test(mobilePhone);
if(!mobileTrue){
this.$toast('请输入正确的手机号');
return;
}
......@@ -184,7 +186,6 @@
return;
}
const { mobilePhone, flag, captchaToken, captchaAnswer } = this;
getAuthCode({mobilePhone, flag, captchaToken, captchaAnswer}).then(res=>{
// 发送成功
if(res.code=='000000'){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册