|
@@ -112,17 +112,16 @@
|
|
|
Http.put('/api/user/mobile', params).then(res => {
|
|
|
this.hideLoading();
|
|
|
if (res.msg == "ERROR") {
|
|
|
- notify('error', '重新绑定失败:' + res.data);
|
|
|
+ notify('error', '绑定失败:' + res.data);
|
|
|
} else {
|
|
|
- notify('success', '重新绑定成功');
|
|
|
+ notify('success', '绑定成功');
|
|
|
this.$router.push({path: '/personal/phoneBinding'});
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
this.hideLoading();
|
|
|
- notify('error', '重新绑定失败:' + err.data);
|
|
|
+ notify('error', '绑定失败:' + err.data);
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
getVerifyCode() {
|
|
|
if (this.active === 0) {
|
|
@@ -132,17 +131,22 @@
|
|
|
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;
|
|
|
+ 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);
|
|
|
})
|
|
@@ -154,17 +158,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);
|
|
|
})
|