Explorar el Código

验证码没有输入时,不进行验证

zhangxc hace 6 años
padre
commit
cc698f13c9

+ 3 - 0
src/components/forgetPassword/FindPassword.vue

@@ -323,6 +323,9 @@
             mobile: this.phone,
             smsCode: this.msgCode
           }
+          if(!this.msgCode.trim()) {
+            return
+          }
           api.vertifyMobileCode(params).then((res) => {
             // 验证成功,切换下一页
             if (+res.data.code == 0) {

+ 14 - 11
src/components/register/Register.vue

@@ -112,14 +112,14 @@
         msgCodeTimer:null,//短信验证码
         msgCodeTime:180,
         codeErrText:'',
-		phoneRg:null, 
-		phoneErrText: '', // 手机号错误提示
-		pswErrText: '', //密码错误提示
-		imgErrText: '', //图像码错误信息
-		SMSErrText: '', //短信验证码错误信息
-		emailErrText:'', //邮箱错误信息提示
-		agencyErrText: '', //机构错误信息提示
-		contactErrText: '' //联系人错误信息提示
+        phoneRg:null, 
+        phoneErrText: '', // 手机号错误提示
+        pswErrText: '', //密码错误提示
+        imgErrText: '', //图像码错误信息
+        SMSErrText: '', //短信验证码错误信息
+        emailErrText:'', //邮箱错误信息提示
+        agencyErrText: '', //机构错误信息提示
+        contactErrText: '' //联系人错误信息提示
       }
     },
     created() {
@@ -342,9 +342,9 @@
             this.pswErrText = "密码过于简单";
             this.psw = "";
           }else{
-			this.pswErrText = "";
-			this.imgCodeErr = false;
-			console.log()
+            this.pswErrText = "";
+            this.imgCodeErr = false;
+            console.log()
           }
         }
 
@@ -356,6 +356,9 @@
           mobile: this.phone,
           smsCode: this.msgCode
         }
+        if(!this.msgCode.trim()) {
+          return
+        }
         api.vertifyMobileCode(params).then((res) => {
           // 验证成功,切换下一页
           if (+res.data.code == 0) {