Browse Source

改造注册获取验证码的接口

xiaozhen 6 years ago
parent
commit
f22695833f
1 changed files with 4 additions and 17 deletions
  1. 4 17
      pages/user/register.vue

+ 4 - 17
pages/user/register.vue

@@ -245,26 +245,13 @@ export default {
         })
         return
       }
-      console.log(area + mobile)
-      let res = await this.$axios.$post('/api/passport/check_registered', {
+      //console.log(area + mobile)
+      let res = await this.$axios.$post('/api/user/sendMobileAuthCode', {
         mobile: area + '-' + mobile,
       })
-      // console.log(res)
       if (res) {
-        if (res.data.registered) {
-          this.$message({
-            message: '手机号已注册',
-            type: 'error'
-          })
-        } else {
-          let res = await this.$axios.$post('/api/user/sendMobileAuthCode', {
-            mobile: area + '-' + mobile,
-          })
-          if (res) {
-            run()
-            this.$message(res.info)
-          }
-        }
+        run()
+        this.$message(res.info)
       }
     },
     /**