收藏
回答

公众号网页授权scope=snsapi_userinfo时,授权后通过物理返回到了快照页?

公众号内嵌页面通过https://open.weixin.qq.com/connect/oauth2/authorize授权,redirect_uri是location.href,scope=snsapi_userinfo,在用户同意授权昵称头像之前,会展示当前快照页,用户同意授权后,通过物理返回按键会再次回到快照页,需要再次授权,请问这种问题如何解决?

window.location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${encodeURIComponent(window.location.href)}&response_type=code&scope=snsapi_userinfo#wechat_redirect`)

回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 该问答由AI生成
    03-29
    有用
登录 后发表内容