|
@@ -123,49 +123,51 @@
|
|
|
|
|
|
},
|
|
|
getVerifyCode() {
|
|
|
- if (this.active === 0) {
|
|
|
- //1.验证原手机
|
|
|
- let params = {
|
|
|
- id: this.user.id,
|
|
|
- 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;
|
|
|
+ if (this.active === 0) {
|
|
|
+ //1.验证原手机
|
|
|
+ let params = {
|
|
|
+ id: this.user.id,
|
|
|
+ mobile: this.phoneBindingForm.phone
|
|
|
}
|
|
|
- }, 1000)
|
|
|
- }).catch(err => {
|
|
|
- notify('error', '获取验证码失败:' + err.data);
|
|
|
- })
|
|
|
- } else {
|
|
|
- //2.验证新手机
|
|
|
- let params = {
|
|
|
- id: this.user.id,
|
|
|
- mobile: this.phoneBindingForm.newPhone
|
|
|
- }
|
|
|
- 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;
|
|
|
+ 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)
|
|
|
+ }).catch(err => {
|
|
|
+ notify('error', '获取验证码失败:' + err.data);
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ //2.验证新手机
|
|
|
+ let params = {
|
|
|
+ id: this.user.id,
|
|
|
+ mobile: this.phoneBindingForm.newPhone
|
|
|
}
|
|
|
- }, 1000)
|
|
|
- }).catch(err => {
|
|
|
- notify('error', '获取验证码失败:' + err.data);
|
|
|
- })
|
|
|
- }
|
|
|
+ console.log("手机号:" + this.phoneBindingForm.newPhone);
|
|
|
+ notify("手机号:" + this.phoneBindingForm.newPhone);
|
|
|
+ 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)
|
|
|
+ }).catch(err => {
|
|
|
+ notify('error', '获取验证码失败:' + err.data);
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
},
|