微信网页登录 跨域 问题

https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx842da89abe2d62b3&redirect_uri=https://g.fupenzi.fun/EagleWeb/api/v1/user/login/webUserInfo&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect
在微信浏览器中可以访问,但以H5发布的游戏在微信浏览器中访问,返回下面的错误:
XMLHttpRequest cannot load https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx842da89abe2d62b3&redirect_uri=https://g.fupenzi.fun/EagleWeb/api/v1/user/login/webUserInfo&response_type=code&scope=snsapi_userinfo&state=123&connect_redirect=1#wechat_redirect. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://g.fupenzi.fun’ is therefore not allowed access.

ccc代码:
var xhr = new XMLHttpRequest();
var url = Const.LOGIN_WX_WEB + cc.js.formatStr("?appid=wx842da89abe2d62b3&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=123&connect_redirect=1#wechat_redirect", “https://g.fupenzi.fun/EagleWeb/api/v1/user/login/webUserInfo”);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if ((xhr.status >= 200 && xhr.status < 400)) {
var response = xhr.responseText;
console.log(response);
}
}
};
xhr.open(“GET”, url, true);
xhr.send();

服务端已设置Header
response.setHeader(“Access-Control-Allow-Origin”, “*”);

上面这个请求是微信登录跳转到服务端,其它从H5网站跳转到服务端的跨域是OK的。
哪位大神知道为什么吗?

究竟是http,还是https,url是s,报错是http:3:

这是跨域问题,你没办法从你自己的服务器页面上访问微信的 oauth url 的,微信的服务器会禁止这种访问方式。用标准的微信 JS API 做吧,别自己创建 xml http request