由于微信自动带hash重定向地址 ,如: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect',重定向的hash地址就会放在#wechat_redirect 位置 导致不管是nginx或者重定向都会产生hash地址在后面,其实用window.history.pushState 无刷新当前href地址就完美解决问题了 写法借鉴下http://blog.tianlinyong.cn/2017/12/01/Vue%E5%BE%AE%E4%BF%A1%E6%8E%88%E6%9D%83/,还蛮好的
微信公众号授权的redirect_url中有#,但是为什么在重定向回来的时候#后的内容到参数中去了?授权地址 https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx60277b2a075ec3b9&redirect_uri=http%3A%2F%2Fwap2.papasportdev.net%2F%23%2Fpages%2Fbase%2Flogin&response_type=code&scope=snsapi_userinfo&state=gotoUrl%3Dhttp%5C%3A%2F%2Fwap2.papasportdev.net%2F%5C%23%2Fpages%2Fbase%2Flogin%3Fnull%0A&uin=NDM3MzE5Mjc1&key=3f1564dfc265cd440443ed667f2333174c4fd48cf6b64b995318f390c720511594cbc96f87270d1747f004376a0ae4e1&pass_ticket=+FDtGw6S8kVFikFhGzL1EPUh3/a0f4/QVT/wgYmIdKLVdKwySeNMLv7/plWHqq+4CTk07n+FDvy2463chd6LNw== 重定向回来之后的地址 http://wap2.papasportdev.net/?code=071vu2mh2tu5rD0Z5aih2gOGlh2vu2mc&state=gotoUrl%3Dhttp%5C%3A%2F%2Fwap-api2.papasportdev.net%2Fweb%2Fexterface%2Fexecute%2Fuser%2FuserLoginInit%3Fnull%0A#/pages/base/login 正常的应该是 http://wap2.papasportdev.net/#/pages/base/login?code=071vu2mh2tu5rD0Z5aih2gOGlh2vu2mc&state=gotoUrl%3Dhttp%5C%3A%2F%2Fwap-api2.papasportdev.net%2Fweb%2Fexterface%2Fexecute%2Fuser%2FuserLoginInit%3Fnull%0A 请问这个要怎么配置
2020-10-27