|
@@ -4,8 +4,6 @@
|
|
|
<el-step title="验证原手机"></el-step>
|
|
|
<el-step title="绑定新手机"></el-step>
|
|
|
</el-steps>
|
|
|
-
|
|
|
-
|
|
|
<el-form label-width="80px" style="width:400px;" :rules="rules" :model="phoneBindingForm" :ref="phoneBindingForm">
|
|
|
<el-form-item label="原手机号" v-if="active===0" prop="phone">
|
|
|
<span v-model="phoneBindingForm.phone">{{this.user.mobile}}</span>
|
|
@@ -123,51 +121,50 @@
|
|
|
|
|
|
},
|
|
|
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;
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
- }).catch(err => {
|
|
|
- notify('error', '获取验证码失败:' + err.data);
|
|
|
- })
|
|
|
- }else{
|
|
|
- //2.验证新手机
|
|
|
- let params = {
|
|
|
- id: this.user.id,
|
|
|
- mobile: this.phoneBindingForm.newPhone
|
|
|
+ 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;
|
|
|
}
|
|
|
- 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);
|
|
|
- })
|
|
|
+ }, 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;
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ }).catch(err => {
|
|
|
+ notify('error', '获取验证码失败:' + err.data);
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
},
|