Browse Source

找回密码验证码问题1122

zhangxc 6 năm trước cách đây
mục cha
commit
993c80762d
1 tập tin đã thay đổi với 11 bổ sung13 xóa
  1. 11 13
      src/components/forgetPassword/FindPassword.vue

+ 11 - 13
src/components/forgetPassword/FindPassword.vue

@@ -34,7 +34,7 @@
                                 <span class="tips" >{{imgErrText}}</span>
                             </div>
                             <div class="yanzm">
-                                <input type="text" name="" v-model="msgCode" maxlength="6" placeholder="短信验证码" @blur="checkMsgCode">
+                                <input type="text" name="" :class="{error: SMSErrText}" v-model="msgCode" maxlength="6" placeholder="短信验证码" @blur="checkMsgCode">
                                 <div v-if="timerFlag" type="primary" class="getMsg disabled">{{'再次发送(' + time + ')'}}</div>
                                 <div v-else class="getMsg" @click="getMsgCode">获取验证码</div>
                                  <span class="tips" v-show="SMSErrText">{{SMSErrText}}</span>
@@ -187,10 +187,10 @@
           }
           api.vertifyImgCode(params).then((res) => {
             if (+res.data.code != 0) {//验证失败
-              this.imgCodeErr = true
+              // this.imgCodeErr = true
               this.imgErrText = "图形验证码错误";
             } else {
-              this.imgCodeErr = false
+              // this.imgCodeErr = false
               /*window.clearInterval(this.picTimer);
               this.picTime = 600*/
               this.imgErrText = "";
@@ -210,11 +210,11 @@
               message: '手机格式不正确',
               type: 'warning'
             });*/
-            this.imgCodeErr = true;
+            // this.imgCodeErr = true;
             this.phoneErrText = "手机格式有误";
             this.phone = "";
           }else{//验证手机号是否注册
-            this.imgCodeErr = false;
+            // this.imgCodeErr = false;
             api.checkForgetTel(this.phone).then((res)=>{
               if(+res.data.code == 0){
                  this.phoneErrText = ''
@@ -236,14 +236,14 @@
             message: '手机号不能为空',
             type: 'warning'
           });*/
-          this.imgCodeErr = true;
+          // this.imgCodeErr = true;
           this.phoneErrText = "手机号不能为空";
         }else if(!this.picCode){
-          this.imgCodeErr = true
+          // this.imgCodeErr = true
           this.imgErrText = "图形验证码不能为空";
         }else{
           //调请求接口
-          if(!this.imgCodeErr){
+          // if(!this.imgCodeErr){
             this.imgCodeErr = false;
             const params = {
               imgCode: this.picCode,
@@ -252,7 +252,6 @@
             }
             api.forgetPswGetMobileCode(params).then((res) => {
               if (+res.data.code == 0) {
-
                 this.$message({
                   message: '验证码发送成功',
                   type: 'success'
@@ -292,7 +291,7 @@
             }).catch((err) => {
               console.log(err);
             })
-          }
+          // }
         }
 
       },
@@ -300,7 +299,6 @@
         // const pswlReg = /^(?![0-9]+$)(?![a-zA-Z]+$)/;
         const pswlReg = utils.pswReg;
         const psw = this.newPsw;
-        console.log('assssssss', psw)
         if (psw) {
           if (psw.trim().length < 6 || psw.trim().length > 16) {
             this.imgCodeErr = true;
@@ -333,7 +331,7 @@
               this.imgCodeErr = false;
             } else {
               // this.$message.error('短信验证码错误');
-              this.imgCodeErr = true;
+              // this.imgCodeErr = true;
               this.SMSErrText = "短信验证码错误";
               this.msgCode = "";
             }
@@ -432,7 +430,7 @@
           if (val.flag == 3) {
             this.nextText = "去登录";
           }
-          if (val.phone.trim() && val.picCode.trim() && val.msgCode.trim() && !val.imgCodeErr && val.flag == 1) {
+          if (val.phone.trim() && val.picCode.trim() && val.msgCode.trim()  && val.flag == 1) {
           // if (val.phone.trim() && val.picCode.trim() && val.msgCode.trim() && val.flag == 1) {
             this.changCor = false;
           } else {