Browse Source

找回密码的手机号验证修改

lizhenhao 2 years ago
parent
commit
aaeae1c2d9
1 changed files with 2 additions and 9 deletions
  1. 2 9
      src/views/modules/sys/login/login.vue

+ 2 - 9
src/views/modules/sys/login/login.vue

@@ -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
       }
     }
   }