扫描小程序码分享
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
其他页面老是弹出登录弹窗,这部分代码可以贴出来看看
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
i.authSetting["scope.userInfo"]
已经能用这种方式判断用户登录了。详细可以参考这篇文章:https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
其他页面老是弹出登录弹窗,这部分代码可以贴出来看看
var a = "/pages/auth/index", i = getCurrentPages(), n = i[i.length - 1], o = {
params: n.options || null,
url: n.route
};
if (o.params.hasOwnProperty("scene")) {
var s = {}, r = decodeURIComponent(o.params.scene).split("&").shift().split("=");
s.id = r[1], o.params = s;
}
this.setCache("routeData", o);
this.getCache("userinfo");
wx.getSetting({
success: function(i) {
i.authSetting["scope.userInfo"] ? (e.get("member", {}, function(e) {
e.error && wx.navigateTo({
url: a
});
}), t && t()) : wx.navigateTo({
url: a
});
}
});
},
就是这个方法,进入页面后会用这个方法判断登陆状态。然后就是跳到 /pages/auth/index这个登陆页面
i.authSetting["scope.userInfo"]
已经能用这种方式判断用户登录了。详细可以参考这篇文章:https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801