m***@foxmail.com
m***@foxmail.com
  • 发布:2021-01-06 21:59
  • 更新:2021-01-07 10:06
  • 阅读:1036

微信登录后logout到底是怎么用的

分类:uni-app

在做一个微信登录退出功能,代码是这样:

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这个生命周期函数

有人知道为啥吗?

2021-01-06 21:59 负责人:无 分享
已邀请:
[已删除]

[已删除]

承接H5、小程序、APP等外包:

  1. 经验丰富,做过多种类型项目,有案例可看;
  2. 整个项目外包可以找我(小团队接单,面向客户、产品);
  3. 只需要前端部分也可以找我(个人接单,面向服务端合作伙伴);
  4. wechat(13070273424);

该问题目前已经被锁定, 无法添加新回复