Redirecting to https://open.wein.qq.com/...

臭大佬 2022-03-29 16:00:43 1484
简介 解决Easywechat授权登录页面出现:Redirecting to https://open.wein.qq.com/...

问题

在用Easywechat 做微信授权登录的时候,发现会请求两次https://open.weixin.qq.com/connect/oauth2/authorize,

中间会跳如下页面,

网上说,在请求接口https://open.weixin.qq.com/connect/oauth2/authorize的时候加一个参数connect_redirect=1,可以解决这个问题,

模拟地址如下:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=xxx&redirect_uri=xxx&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect,

但是看Easywechat本来就带有这个参数,

这个我们就不管他了,

现在主要解决跳Redirecting to https://open.wein.qq.com/...页的问题,这个页面给人的体验很不好,

解决

根据页面的title,可以定位到vendor/symfony/http-foundation/RedirectResponse.php,

title改成跳转中...,并且隐藏body

效果如下:

这样用户体验就会好点,至少看上去不会像bug页面。