前后端设置都是一样的 为什么还提示 错误码:10003
const appId = 'wxc2bd5c73204be4f8';
const redirectUri = encodeURIComponent("http://zhaofei.online/Home/Login");
const authUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
console.log("跳转授权地址:", authUrl); // 调试用,查看实际跳转地址
window.location.href = authUrl;
服务号:民航招飞

js 模板语法都不会啊,是反引号
const redirectUri = encodeURIComponent('http://zhaofei.online/Home/Login');
const authUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`;
window.location.href = authUrl;
用模板字符串语法,这里不应该是用 ` 反引号吗?
我刚试了下,网页授权没有复现 10003 的问题呀。
url参数不是传code了?
const redirectUri = encodeURIComponent('http://zhaofei.online/Home/Login');
const authUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`;
window.location.href = authUrl;
现在就是我这边请求微信接口获取code,微信也接收到了我的请求并且回调到了我的login接口,但是并没有给我code。
并且还提示前后域名不一致,我都有截图,明明一致