wangJJ преди 5 години
родител
ревизия
2434e36eb3
променени са 1 файла, в които са добавени 14 реда и са изтрити 10 реда
  1. 14 10
      src/pages/UserCenter/ReBindingMobile.vue

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

@@ -132,17 +132,21 @@
             mobile: this.phoneBindingForm.phone
           }
           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;
+              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);
           })