Przeglądaj źródła

修复点击获取邮箱验证码提示问题

guo00guo 5 lat temu
rodzic
commit
c4fe48a326
1 zmienionych plików z 15 dodań i 9 usunięć
  1. 15 9
      src/pages/UserCenter/ReBindingMail.vue

+ 15 - 9
src/pages/UserCenter/ReBindingMail.vue

@@ -100,15 +100,21 @@
         Http.put('/api/verify/email', params).then((res) => {
           this.hasVerifyCode = true;
           let _this = this;
-          let codeTimer = setInterval(function () {
-            if (_this.codeTime > 0) {
-              _this.codeTime--;
-            } else {
-              clearInterval(codeTimer);
-              _this.hasVerifyCode = false;
-              this.codeTime = 10;
-            }
-          }, 1000)
+          if (res.msg == "ERROR") {
+            notify('error', '验证码获取失败:' + res.data);
+          }else{
+            notify('success', res.data);
+            let codeTimer = setInterval(function () {
+              if (_this.codeTime > 0) {
+                _this.codeTime--;
+              } else {
+                clearInterval(codeTimer);
+                _this.hasVerifyCode = false;
+                this.codeTime = 10;
+              }
+            }, 1000)
+          }
+
         }).catch(err => {
           notify('error', '获取验证码失败:' + err.data);
         })