Commit fe844c9d authored by linwenqing's avatar linwenqing

fix:授权手机号

parent 74880ce6
......@@ -149,6 +149,7 @@ export default {
let params = {}
if (e && e.detail) {
if (e.detail.errMsg.indexOf('user deny') > -1) {
uni.hideLoading()
this.$refs.uToast.show({
title: '用户拒绝授权',
type: 'warning',
......@@ -162,6 +163,7 @@ export default {
iv: e.detail.iv,
}
} else {
uni.hideLoading()
this.$refs.uToast.show({
title: '用户取消授权',
type: 'warning',
......@@ -170,6 +172,7 @@ export default {
return
}
} else {
uni.hideLoading()
this.$refs.uToast.show({
title: '授权失败,请重新授权',
type: 'warning',
......@@ -202,8 +205,14 @@ export default {
},
})
},
inGetPhone() {
uni.showLoading({
title: '授权中...',
})
},
refleshCode() {
let that = this
this.inGetPhone()
uni.login({
provider: 'weixin',
success: (code_res) => {
......@@ -219,11 +228,13 @@ export default {
.loginWechatAuth(params)
.then((res) => {
this.student.phoneNumber = res.phoneNumber
this.inGetPhone()
this.$u.api
.updateUserInfo({
phoneNumber: res.phoneNumber,
})
.then((ret) => {
uni.hideLoading()
this.$refs.uToast.show({
title: '绑定成功!',
type: 'success',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment