当回调url中携带了中文字符时,就会在用户手动点击确认授权时处理上面的问题,把url中的参数进行了encodeURI也不行,但是如果换成数字或英文就不会出现上述问题!
// 第一次请求url
https://api.xxxxx.cn/groupBuying/v1/wxSdk/getWxUserBaseInfo?activityId=KaFJg88ZZ038G655pc862L1fNT56SBvj&recommendUid=lyfz_J9P238e9oveor60P9QxX82qy75mffA0s&positionName=%E7%B2%BE%E4%BF%AE%E5%B8%88&recommendName=%E5%B0%8F%E5%96%BB
// 重定向到微信授权的url
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx5d138ab5c8b13960&redirect_uri=https%3A%2F%2Fapi.xxxxx.cn%2FgroupBuying%2Fv1%2FwxSdk%2FgetCodeByWxBaseInfo%3FactivityId%3DKaFJg88ZZ038G655pc862L1fNT56SBvj%26wId%3Dnull%26extensionId%3Dnull%26recommendUid%3Dlyfz_J9P238e9oveor60P9QxX82qy75mffA0s%26ccId%3Dnull%26positionName%3D%E7%B2%BE%E4%BF%AE%E5%B8%88%26recommendName%3D%E5%B0%8F%E5%96%BB&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1&uin=MTMyODcwMjMwNw%3D%3D&key=72f7f12b08ba575c42ac748e17b6d5957c3dd78315ac24227fc3e4699fb839bfb91dba09e072ed55308710a87cd5e011&pass_ticket=I+Rfid/LhYj0Qg3lVCL8eGntk0XLE8KTQRMkN3Kolao9/3uzlKA4Xaj+3o7X+7NaXut1gifQpO21UlXa4DcTxe+RALnu9p4Jez8iT+h3hrc=&webdebugger_source=1&exportkey=n_ChQIAhIQ1WncFxV%2BRIaVyJRRENVt7RKxAQIE97dBBAEAAAAAANgSFdoOKR8AAAAOpnltbLcz9gKNyK89dVj0L1f6hFzK%2Bj4b5G3qV%2BLLmV1T4xUbd5cns3at3m78pS%2F3UJhHbwiIdJgIuBM7DJiTZ7MX7EfpFSMgE0FmP1AoUrLMqT8cOBEFNBieP86D%2Frvw1j2yjySSRXXsmtAGia7IHVawt1X3e7urVq1tEzQHfP3TE0A%2FzO4kDkcoU6Ora5bEztdwiy6pmSh97Q%3D%3D
你好,请提供正确的授权请求包
https://api.whccd.cn/groupBuying/v1/wxSdk/getWxUserBaseInfo?activityId=KaFJg88ZZ038G655pc862L1fNT56SBvj&recommendUid=lyfz_J9P238e9oveor60P9QxX82qy75mffA0s&positionName=%E7%B2%BE%E4%BF%AE%E5%B8%88&recommendName=%E5%B0%8F%E5%96%BB
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx5d138ab5c8b13960&redirect_uri=https%3A%2F%2Fapi.whccd.cn%2FgroupBuying%2Fv1%2FwxSdk%2FgetCodeByWxBaseInfo%3FactivityId%3DKaFJg88ZZ038G655pc862L1fNT56SBvj%26wId%3Dnull%26extensionId%3Dnull%26recommendUid%3Dlyfz_J9P238e9oveor60P9QxX82qy75mffA0s%26ccId%3Dnull%26positionName%3D%E7%B2%BE%E4%BF%AE%E5%B8%88%26recommendName%3D%E5%B0%8F%E5%96%BB&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1&uin=MTMyODcwMjMwNw%3D%3D&key=72f7f12b08ba575c42ac748e17b6d5957c3dd78315ac24227fc3e4699fb839bfb91dba09e072ed55308710a87cd5e011&pass_ticket=I+Rfid/LhYj0Qg3lVCL8eGntk0XLE8KTQRMkN3Kolao9/3uzlKA4Xaj+3o7X+7NaXut1gifQpO21UlXa4DcTxe+RALnu9p4Jez8iT+h3hrc=&webdebugger_source=1&exportkey=n_ChQIAhIQ1WncFxV%2BRIaVyJRRENVt7RKxAQIE97dBBAEAAAAAANgSFdoOKR8AAAAOpnltbLcz9gKNyK89dVj0L1f6hFzK%2Bj4b5G3qV%2BLLmV1T4xUbd5cns3at3m78pS%2F3UJhHbwiIdJgIuBM7DJiTZ7MX7EfpFSMgE0FmP1AoUrLMqT8cOBEFNBieP86D%2Frvw1j2yjySSRXXsmtAGia7IHVawt1X3e7urVq1tEzQHfP3TE0A%2FzO4kDkcoU6Ora5bEztdwiy6pmSh97Q%3D%3D
需要对整个`redirect_uri`进行编码
redirect_uri=encodeURIComponent('https://api.xxxxx.cn/groupBuying/v1/wxSdk/getWxUserBaseInfo?activityId=KaFJg88ZZ038G655pc862L1fNT56SBvj&recommendUid=lyfz_J9P238e9oveor60P9QxX82qy75mffA0s&positionName=中文&recommendName=中文')
不能分别对每个参数值进行编码
https://api.xxxxx.cn/groupBuying/v1/wxSdk/getWxUserBaseInfo?activityId=KaFJg88ZZ038G655pc862L1fNT56SBvj&recommendUid=lyfz_J9P238e9oveor60P9QxX82qy75mffA0s&positionName=123&recommendName=1111
这样写就没问题,是redirect_url不支持中文吗?