ng 判定输入的手机号是否正确
判定输入的手机号是否正确
infoConfirm(){
if (!/^1[3456789]\d{9}$/.test(this.mobile)) {
this.phoneInfo = true;
return setTimeout(() => {
this.phoneInfo = false;
}, 3000)
}
if (!this.codeNumber || !/^\d{4}$/.test(this.codeNumber.toString())) {
this.codetip = true
return setTimeout(() => {
this.codetip = false; //信息提示框
}, 3000)
}
this.playerService.getPhoneUrl(this.mobile, this.codeNumber).subscribe(
res =>{
console.log(res);
if (parseInt(res.code) === 200) {
console.log(res.code);
this.phonePup = false //信息提示框
console.log(this.phonePup);
// this.tokenUtil.setToken(res.data.token) //之前的token验证。可以去掉
}
}
)
}