在做一个微信登录退出功能,代码是这样:
plus.oauth.getServices((services) => {
this.weixinAuthService = services.find((service) => {
return service.id === 'weixin'
})
});
......
this.weixinAuthService.authorize(function(res) {
try {
self.weixinAuthService.logout(function(e) {
self.showModal = false;
}, function(e) {
self.showModal = false;
});
} catch (e) {
//TODO handle the exception
}
},function(error) {}, {
scope: 'snsapi_userinfo'
})
有一件奇怪的事:
self.weixinAuthService.logout调用后,触发了当前组件的onShow这个生命周期函数
有人知道为啥吗?
m***@foxmail.com (作者)
要不要分点活给我
2021-01-07 10:49