为什么设置了域名,微信还是跨域拒绝?
XMLHttpRequest cannot load https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxc295e9******5464&secret=3b8c9560ad88************290ba4d0. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://wujinzhilu.com' is therefore not allowed access.
FIRST
9 years, 11 months ago
Answers
这样会跨域的,你代码的服务器的域名一定跟微信的域名不一样的,token只能通过服务端取,官方有demo: http://demo.open.weixin.qq.com/jssdk/sample.zip ,你在公众号后台配置的域名是用来给微信做验证用的,不是用来解决跨域的。
大概是摸了
answered 9 years, 11 months ago