Browse Source

feat(RegisterBar.vue):注册邮件需要验证

liyangbin 2 years ago
parent
commit
f218c659af
1 changed files with 8 additions and 4 deletions
  1. 8 4
      components/RegisterBar.vue

+ 8 - 4
components/RegisterBar.vue

@@ -15,7 +15,7 @@ export default {
       errMsg: '',
       sending: false,
       clock: 60,
-      showVcode: false,
+      showVcode: true,
       regEmail,
       regPhone,
     }
@@ -26,7 +26,7 @@ export default {
     }
   },
   methods: {
-// 点击注册前置校验
+    // 点击注册前置校验
     vailidate() {
       if(!this.regPhone.test(this.form.username) && !this.regEmail.test(this.form.username)) {
         this.errMsg = '手机号/邮箱格式不对'
@@ -41,6 +41,7 @@ export default {
         this.handlerRegisterUser()
       }
     },
+    //注册
     handlerRegisterUser() {
       this.$axios.post('members/register',this.form).then((res)=> {
         if(res.code === 200) {
@@ -51,6 +52,7 @@ export default {
         }
       })
     },
+    //发送验证码
     handlePostCode() {
       if(this.sending) return
       const params = {
@@ -74,6 +76,7 @@ export default {
         }
       })
     },
+    //登录
     handlerLogin() {
       this.$axios.post('login',qs.stringify(this.form)).then((res)=> {
         this.$store.dispatch('login',res.result).then((token)=> {
@@ -92,7 +95,8 @@ export default {
       })
     },
     handlerUsernameBlur(e) {
-      this.showVcode = this.regPhone.test(e.target.value)
+      // this.showVcode = this.regPhone.test(e.target.value)
+      this.showVcode = true
     },
     // 弹窗关闭,初始化注册面板
     resetInterfaceStatus() {
@@ -101,7 +105,7 @@ export default {
       this.form.password = ''
       this.form.passwordConfirm = ''
       this.form.verifyCode = ''
-      this.showVcode = false
+      this.showVcode = true
     },
     handlerChangeLogin() {
       this.$emit('login','login')