|
@@ -333,7 +333,7 @@
|
|
|
},
|
|
|
pushPhoneCode () {
|
|
|
// 验证手机号码格式是否正确
|
|
|
- if (this.checkPhoneNumber()) {
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.phoneNumber) && this.validateXG.isMobile(this.inputForm.phoneNumber)) {
|
|
|
// 向手机号发送验证码
|
|
|
this.loginService.getPhoneCode(this.inputForm.phoneNumber).then(({data}) => {
|
|
|
if (data.success) {
|
|
@@ -357,16 +357,9 @@
|
|
|
this.$message.error(data.message)
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
- },
|
|
|
- // 验证手机号码
|
|
|
- checkPhoneNumber () {
|
|
|
- let phone = this.inputForm.phoneNumber
|
|
|
- if (!/^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(19[0-9]{1}))+\d{8})$/.test(phone)) {
|
|
|
+ } else {
|
|
|
this.$message.error('请填写正确的手机号')
|
|
|
- return false
|
|
|
}
|
|
|
- return true
|
|
|
}
|
|
|
}
|
|
|
}
|