|
|
@@ -177,25 +177,37 @@ export default {
|
|
|
|
|
|
try {
|
|
|
// 调用发送验证码API
|
|
|
- const res = await this.request({
|
|
|
- url: '/msg/sendMsg/' + this.newPhone + '/changePhone',
|
|
|
- method: 'GET'
|
|
|
+ this.$Request.getT("/app/Login/sendMsg/" + this.newPhone + "/1").then((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.code === 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '验证码发送成功',
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+ this.startCountdown();
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg || '发送失败,请重试',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
+ // const res = await this.$Request.getT("/app/Login/sendMsg/" + this.newPhone + "/1")
|
|
|
|
|
|
- uni.hideLoading();
|
|
|
+ // uni.hideLoading();
|
|
|
|
|
|
- if (res.status === 0) {
|
|
|
- uni.showToast({
|
|
|
- title: '验证码发送成功',
|
|
|
- icon: 'success'
|
|
|
- });
|
|
|
- this.startCountdown();
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: res.msg || '发送失败,请重试',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (res.status === 0) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '验证码发送成功',
|
|
|
+ // icon: 'success'
|
|
|
+ // });
|
|
|
+ // this.startCountdown();
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: res.msg || '发送失败,请重试',
|
|
|
+ // icon: 'none'
|
|
|
+ // });
|
|
|
+ // }
|
|
|
} catch (error) {
|
|
|
uni.hideLoading();
|
|
|
uni.showToast({
|
|
|
@@ -239,29 +251,24 @@ export default {
|
|
|
|
|
|
try {
|
|
|
const userId = uni.getStorageSync('userId');
|
|
|
- const res = await this.request({
|
|
|
- url: '/user/changePhone',
|
|
|
- method: 'GET',
|
|
|
- data: {
|
|
|
- userId: userId,
|
|
|
- phone: this.newPhone,
|
|
|
- msg: this.verificationDigits.join('')
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+ // 验证手机号接口
|
|
|
+ const res = await this.$Request.postJson("/xxx/xxx/xxx", {
|
|
|
+ phone: this.newPhone,
|
|
|
+ code: this.verificationDigits.join(''),
|
|
|
+ })
|
|
|
uni.hideLoading();
|
|
|
-
|
|
|
- if (res.status === 0) {
|
|
|
+ if (res.code === 0) {
|
|
|
uni.showToast({
|
|
|
- title: '修改成功',
|
|
|
+ title: '手机号验证成功',
|
|
|
icon: 'success'
|
|
|
});
|
|
|
setTimeout(() => {
|
|
|
- uni.navigateBack();
|
|
|
+ this.$queue.setData('newPhone', this.newPhone);
|
|
|
+ uni.navigateBack()
|
|
|
}, 1500);
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
- title: res.msg || '修改失败',
|
|
|
+ title: res.msg || '手机号验证失败',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|