请求OPEN_ID时报跨域错误
请求:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxxx&redirect_uri=http%3A%2F%2Fshop.cake.com%2FUser%2Fregister.html&response_type=code&scope=snsapi_base&state=STATE
报错:
XMLHttpRequest cannot load https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxxx…ster.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://vanwardshop.yonxin.com' is therefore not allowed access.
由于隐私 ,appid和 redirect_uri 的值 改了一下才发到论坛上来。