网页授权需要多次后退才能关闭【附实例代码】
发布于 5 年前 作者 qiangtan 1933 次浏览 来自 问答

静态页面跳转(location.replace)公众号网页base授权页面,授权完成后再点左上角返回,将会再次返回上一页。

如实例所示,当跳转成功后点击后退理应回不到index.html页面才对,但是location.replace 并未生效。

期待官方的解答。

目前手里的环境都能重现,包括:

IOS  微信 6.6.2

Android 微信 6.6.5

开发者工具 v1.02.1803210

实例代码 index.html:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>测试授权第一页1</title>
        <script type="text/javascript">
            location.replace('https://open.weixin.qq.com/connect/oauth2/authorize?appid={APPID}&redirect_uri={URL}&response_type=code&scope=snsapi_base&state=base#wechat_redirect');
         
        </script>
    </head>
    <body>
        <h1>111111111111111111111111111111111</h1>
    </body>
</html>
3 回复

有其他同学遇到相同问题吗?

确实不生效,就跳微信连接的时候出问题

回到顶部