فهرست منبع

短信快捷登录逻辑修改(去掉手机号失去焦点的校验)

hangb 7 سال پیش
والد
کامیت
96f9b78e9a
1فایلهای تغییر یافته به همراه7 افزوده شده و 18 حذف شده
  1. 7 18
      components/login/Login.vue

+ 7 - 18
components/login/Login.vue

@@ -227,22 +227,8 @@
         if (value === '') {
           this.checkMobile = false
         } else {
-          if (this.fastLogin.mobile !== '') {
-            // 判断手机号是否已被注册
-            this.$http.get(`/api/user/checkMobile`, {params: {mobile: this.fastLogin.mobile}})
-              .then(response => {
-                if (response.data.hasRegister) {
-                  this.checkMobile = true
-                } else {
-                  this.$message.error('手机号未注册,请先注册!')
-                  this.checkMobile = false
-                  return Promise.reject(response.data)
-                }
-              }).catch(err => {
-                this.$message.error(err.errMsg)
-              })
-            callback()
-          }
+          this.checkMobile = true
+          callback()
         }
       }
       var validateCode = (rule, value, callback) => {
@@ -622,6 +608,7 @@
       // 获取校验码
       getCheckCode () {
         this.isShowLoading = true
+        console.log(111)
         if (!this.fastLogin.mobile) {
           this.isShowLoading = false
           this.$message.error('请先填写手机号')
@@ -631,8 +618,8 @@
               .then(response => {
                 this.isShowLoading = false
                 if (response.data) {
-                  this.token = response.data.content.token
-                  if (this.token !== '') {
+                  if (response.data.success) {
+                    this.token = response.data.content.token
                     this.$message({
                       message: '验证码已经发送到您的手机,请注意查收',
                       type: 'success'
@@ -646,6 +633,8 @@
                         clearInterval(loginTime)
                       }
                     }, 1000)
+                  } else {
+                    this.$message.error(response.data.errMsg)
                   }
                 } else {
                   return Promise.reject(response.data)