encodeURIComponent(url)就可以了
公众号网页开发中授权登录获取code步骤的回调地址带#就返回有误?[图片] 第一步的时候我把地址给的redirect_uri地址为 https://aaa.com/#/bbb/ccc,中间带了一个#, 获取code的时候跳转的地址为https://aaa.com/?code=CODE&state=STATE#bbb/ccc 根据#自动截断了然后在给我拼到了最后,请问有谁遇到过吗?
2020-07-28encodeURIComponent(url)就可以了
微信公众号授权的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-07-28