最新版微信web开发者工具无法跨域访问接口
发布于 5 年前 作者 lina 9230 次浏览 来自 问答

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

5 回复

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版本中不正常。

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

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

最新版(0.15.152900)的有跨域BUG

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

回到顶部