const replaceUrl = ()=> {
const params = {
appid: 'wxef571c309f0f3841',
// redirect_uri: encodeURIComponent('https://2330290qr8.zicp.fun'),
redirect_uri: encodeURIComponent('http://192.168.31.210:10086'),
response_type: "code",
scope: 'snsapi_userinfo',
state: '11111'
}
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?${qs.stringify(params)}#wechat_redirect`;
}
请问这么填有什么问题?始终报错uri参数错误;
上面注释的内网穿透地址也不行
生成的地址:https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxef571c309f0f3841&redirect_uri=http%253A%252F%252F192.168.31.210%253A10086&response_type=code&scope=snsapi_userinfo&state=11111#wechat_redirect
知道了,qs.stringify的时候本身就会encode