Forráskód Böngészése

找回密码提示消息添加关闭

zhangxc 6 éve
szülő
commit
0d3f93cd53

+ 20 - 9
src/components/forgetPassword/FindPassword.vue

@@ -154,11 +154,13 @@
               if ((that.picTime--) <= 0) {
                 this.$message({
                   message: '图形验证码已过期',
-                  type: 'warning'
+                  type: 'warning',
+                  showClose: true
                 });
                 that.picCode = '';
                 that.picTime = 600//图形验证码过期时间10分钟;
                 window.clearInterval(that.picTimer);
+                that.picTimer = null
                 that.getPicCode();//过期刷新验证码
               }
             }, 1000);
@@ -166,7 +168,8 @@
           } else {
             this.$message({
               message: res.data.msg,
-              type: 'warning'
+              type: 'warning',
+              showClose: true
             });
 
           }
@@ -208,7 +211,8 @@
           if (!reg.test(this.phone)) {
             /*this.$message({
               message: '手机格式不正确',
-              type: 'warning'
+              type: 'warning',
+              showClose: true
             });*/
             // this.imgCodeErr = true;
             this.phoneErrText = "手机号格式有误";
@@ -222,7 +226,8 @@
                 this.phoneErrText = ''
                 this.$message({
                   message: res.data.msg,
-                  type: 'warning'
+                  type: 'warning',
+                  showClose: true
                 });
                 this.phone = "";
               }
@@ -234,7 +239,8 @@
         if(!this.phone){
           /*this.$message({
             message: '手机号不能为空',
-            type: 'warning'
+            type: 'warning',
+            showClose: true
           });*/
           // this.imgCodeErr = true;
           this.phoneErrText = "手机号不能为空";
@@ -254,7 +260,8 @@
               if (+res.data.code == 0) {
                 this.$message({
                   message: '验证码发送成功',
-                  type: 'success'
+                  type: 'success',
+                  showClose: true
                 });
                 //按钮倒计时
                 this.timerFlag = true;
@@ -272,11 +279,13 @@
                   if ((that.msgCodeTime--) <= 0) {
                     this.$message({
                       message: '短信验证码已过期,请重新获取',
-                      type: 'warning'
+                      type: 'warning',
+                      showClose: true
                     });
                     that.msgCode = '';
                     that.msgCodeTime = 180;
                     window.clearInterval(that.msgCodeTimer);
+                    that.msgCodeTimer = null;
                   }
                 }, 1000);
 
@@ -284,7 +293,8 @@
                 console.log(res.data);
                 this.$message({
                   message: res.data.msg,
-                  type: 'warning'
+                  type: 'warning',
+                  showClose: true
                 });
                 // return
               }
@@ -388,7 +398,8 @@
                 }else {
                   this.$message({
                     message: res.data.msg,
-                    type: 'warning'
+                    type: 'warning',
+                    showClose: true
                   });
                   this.newPsw = "";
                   this.newPswAgain = "";

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

@@ -158,7 +158,8 @@
         if (contactReg.test(this.contact)) {
           /*this.$message({
             message: '联系人只能输入中文',
-            type: 'warning'
+            type: 'warning',
+            showClose: true,
           });*/
           this.imgCodeErr = true;
           this.contactErrText = "联系人只能输入中文";
@@ -183,7 +184,8 @@
               if ((that.picTime--) <= 0) {
                 this.$message({
                   message: '图形验证码已过期',
-                  type: 'warning'
+                  type: 'warning',
+                  showClose: true,
                 });
                 that.picCode = '';
                 that.picTime = 600//图形验证码过期时间10分钟;
@@ -232,7 +234,8 @@
           if (!reg.test(this.phone)) {
             // this.$message({
             //   message: '手机格式不正确',
-            //   type: 'warning'
+            //   type: 'warning',
+            // showClose: true,
 			// });
 			this.phoneErrText = '手机号格式有误'
           
@@ -247,7 +250,8 @@
               }else{
                 this.$message({
                   message: res.data.msg,
-                  type: 'warning'
+                  type: 'warning',
+                  showClose: true,
                 });
                 this.phone = "";
               }
@@ -256,7 +260,8 @@
         }else{
           /*this.$message({
             message: '手机号不能为空',
-            type: 'warning'
+            type: 'warning',
+            showClose: true,
           });*/
         }
       },
@@ -267,7 +272,8 @@
           this.phoneErrText = "手机号不能为空";
           /*this.$message({
             message: '手机号不能为空',
-            type: 'warning'
+            type: 'warning',
+            showClose: true,
           });*/
         }else if(!this.psw.trim()){
           this.imgCodeErr = true;
@@ -287,7 +293,8 @@
 
               this.$message({
                 message: '验证码发送成功',
-                type: 'success'
+                type: 'success',
+                showClose: true,
               });
 
               //按钮倒计时
@@ -307,7 +314,8 @@
                 if ((that.msgCodeTime--) <= 0) {
                   this.$message({
                     message: '短信验证码已过期,请重新获取',
-                    type: 'warning'
+                    type: 'warning',
+                    showClose: true,
                   });
                   that.msgCode = '';
                   that.msgCodeTime = 180;
@@ -321,7 +329,8 @@
               console.log(res.data);
               this.$message({
                 message: res.data.msg,
-                type: 'warning'
+                type: 'warning',
+                showClose: true,
               });
               // return
             }
@@ -424,7 +433,8 @@
           if (+res.data.code == 0) {
             this.$message({
               message: '恭喜您,注册成功!',
-              type: 'success'
+              type: 'success',
+              showClose: true,
             });
             //注册成功,跳转登录
             this.$router.push({path: '/'})
@@ -432,7 +442,8 @@
             this.submitCor = true;//注册失败,按钮变灰
             this.$message({
               message: res.data.msg,
-              type: 'warning'
+              type: 'warning',
+              showClose: true,
             });
           }
         }).catch((err) => {