![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLiAzNfRHLGZkRGZkRfJ3bs92YsYTMfVmepNHLwo0MidXMXFGdGdlW5JlMMBjVtJWd0ckW65UbM5WOHJWa5kHT20ESjBjUIF2X0hXZ0xCMx81dvRWYoNHLrdEZwZ1Rh5WNXp1bwNjW1ZUba9VZwlHdssmch1mclRXY39CXldWYtlWPzNXZj9mcw1ycz9WL49zZuBnLxUTOzUDNzATM0AjMxkTMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
要实现解绑微信号,也就是解除授权
wxhtml:
<view bindtap="individualBtn">
<text>换绑微信号</text>
<image src="../../../img/signIn/1591571968980_.pic_hd.jpg"></image>
</view>
点击完成后,会出现一个弹窗
wxjs:
individualBtn() {
wx.showModal({
title: '警告',
content: '确定退出当前微信号',
success(res) {
if (res.confirm) {
wx.openSetting({
success(res) {
console.log(res.authSetting, '退出是否成功')
// res.authSetting = {
// "scope.userInfo": true,
// "scope.userLocation": true
// }
wx.reLaunch({
url: '../../login/loginAccounts/index'
})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
wx.openSetting可以重新设置是否授权
wx.openSetting({
success(res) {
console.log(res.authSetting, '退出是否成功')
// res.authSetting = {
// "scope.userInfo": true,
// "scope.userLocation": true
// }
wx.reLaunch({
url: '../../login/loginAccounts/index'
})
}
})