最新版微信web开发者工具无法跨域访问接口

发布于 7 年前作者 lina9396 次浏览最后编辑 7 年前来自 ask

2017.02.06、2017.02.09这两个版本在调试公众号网页的时候发现都不能调用跨域ajax接口了,之前的版本是可以的

5 回复
guiyinghou
guiyinghou1 楼6 年前

XMLHttpRequest cannot load http://xx.xx.net/user/m. A wildcard ‘*’ cannot be used in the ‘Access-Control-Allow-Origin’ header when the credentials flag is true. Origin ‘http://localhost:8081’ is therefore not allowed access. The credentials mode of an XMLHttpRequest is controlled by the withCredentials attribute.

在0.7版本的微信开发工具 中是可以的,在0.15版本中不正常。

caowei
caowei2 楼6 年前

怎么回事呢,如何解决的,害的我一直用的老版本的工具

pingchang
pingchang3 楼6 年前

这个是因为你调用的CGI的回包没有加允许跨域的头吧

lei01
lei014 楼6 年前

最新版(0.15.152900)的有跨域BUG

liangyan
liangyan5 楼5 年前

附上不同版本的图,新版的发送了options请求之后就不再发送post请求了,而且这个功能在线上是没问题的,所以应该是最新微信web开发者工具的bug