Commit 74880ce6 authored by linwenqing's avatar linwenqing

fix:授权手机号:1、授权手机号一次以后再授权失败,2、安卓手机点设备返回键提示微信自带的英文提示

parent 42e8efbf
......@@ -36,7 +36,7 @@
</view>
</u-cell-item>
<u-cell-item title="手机号">
<view slot="right-icon">
<view slot="right-icon" @click.capture="refleshCode">
<button
open-type="getPhoneNumber"
@getphonenumber="getPhonenumber"
......@@ -118,7 +118,6 @@ export default {
},
onLoad() {
getApp().trackPage('我的信息')
this.refleshCode()
this.$u.api.getQiNiuToken({ bucketName: 'wsy-exam' }).then((res) => {
this.qiToken = res
getApp().globalData.qiNiuToken = res
......@@ -150,7 +149,11 @@ export default {
let params = {}
if (e && e.detail) {
if (e.detail.errMsg.indexOf('user deny') > -1) {
//拒绝授权
this.$refs.uToast.show({
title: '用户拒绝授权',
type: 'warning',
duration: 2000,
})
return
} else if (e.detail.encryptedData && e.detail.iv) {
//允许授权-解析-更新手机号
......@@ -160,8 +163,8 @@ export default {
}
} else {
this.$refs.uToast.show({
title: e.detail.errMsg,
type: 'error',
title: '用户取消授权',
type: 'warning',
duration: 2000,
})
return
......@@ -169,7 +172,7 @@ export default {
} else {
this.$refs.uToast.show({
title: '授权失败,请重新授权',
type: 'error',
type: 'warning',
duration: 2000,
})
return
......@@ -195,11 +198,7 @@ export default {
},
fail() {
// session_key 已经失效,需要重新执行登录流程
setTimeout(() => {
uni.navigateTo({
url: 'pages/login/index',
})
}, 800)
that.toLogin()
},
})
},
......@@ -233,17 +232,7 @@ export default {
})
})
.catch((err) => {
this.$refs.uToast.show({
title: '请登录后再绑定',
type: 'warning',
duration: 2000,
})
this.$u.route({
url: 'pages/login/index',
params: {
path: 'pages/mine/info',
},
})
this.toLogin()
})
},
changeHead() {
......@@ -279,6 +268,13 @@ export default {
this.$u.api.updateUserInfo(params)
})
},
userRefuseTip() {
this.$refs.uToast.show({
title: '用户拒绝授权',
type: 'warning',
duration: 2000,
})
},
toLogin() {
this.$refs.uToast.show({
title: '登录信息已失效,请重新登录',
......@@ -288,6 +284,9 @@ export default {
setTimeout(() => {
uni.navigateTo({
url: 'pages/login/index',
params: {
path: 'pages/mine/info',
},
})
}, 800)
},
......
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