improve: 个人中心手机号获取优化

This commit is contained in:
From-wh 2023-03-22 17:46:04 +08:00
parent 2593180cb7
commit a296d76eda

View File

@ -170,7 +170,7 @@
userEdit,
getLogout,
getLangList,
getLangJson,
getLangJson,
mpBindingPhone
} from '@/api/user.js';
import {
@ -257,29 +257,31 @@
});
},
getphonenumber(e) {
Routine.getCode()
.then(code => {
let data = {
code,
iv: e.detail.iv,
encryptedData: e.detail.encryptedData,
}
mpBindingPhone(data).then(res => {
this.getUserInfo()
this.$util.Tips({
title: res.msg,
icon: 'success'
});
}).catch(err => {
return this.$util.Tips({
title: err
});
console.log(e)
if (e.detail.errMsg == 'getPhoneNumber:ok') {
Routine.getCode()
.then(code => {
let data = {
code,
iv: e.detail.iv,
encryptedData: e.detail.encryptedData,
}
mpBindingPhone(data).then(res => {
this.getUserInfo()
this.$util.Tips({
title: res.msg,
icon: 'success'
});
}).catch(err => {
return this.$util.Tips({
title: err
});
})
})
})
.catch(error => {
uni.hideLoading();
});
.catch(error => {
uni.hideLoading();
});
}
},
setLang() {
this.array.map((item, i) => {