Browse Source

修改update

guo00guo 5 years ago
parent
commit
5ec8660123
1 changed files with 17 additions and 10 deletions
  1. 17 10
      src/pages/UserCenter/ReBindingMobile.vue

+ 17 - 10
src/pages/UserCenter/ReBindingMobile.vue

@@ -137,6 +137,7 @@
               notify('error', '验证码获取失败:' + res.data);
             }else{
               this.hasVerifyCode = true;
+              notify('success', res.data);
               let codeTimer = setInterval(function () {
                 if (_this.codeTime > 0) {
                   _this.codeTime--;
@@ -158,17 +159,23 @@
           }
 
           Http.put('/api/verify/mobile', 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{
+              this.hasVerifyCode = true;
+              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);
           })