收藏
回答

微信 web 开发者工具,跨域调用资源的时候报错

错误一

XMLHttpRequest cannot load https://test.com/ws/target. The 'Access-Control-Allow-Origin' header contains multiple values 'https://a.com, *', but only one is allowed. Origin 'https://a.com' is therefore not allowed access.


错误二

XMLHttpRequest cannot load https://api.growingio.com/v2/zzzaaa/web/action?stm=1489659172277. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'https://a.com' is therefore not allowed access. The credentials mode of an XMLHttpRequest is controlled by the withCredentials attribute.

回答关注问题邀请回答
收藏

2 个回答

  • 洋葱头
    洋葱头
    2017-03-17

    可否截图看下具体的报错信息

    2017-03-17
    有用
    回复
  • gitfree
    gitfree
    2017-03-27

    我也遇到一样的问题,提问的人已经写的很清楚了,控制台打印的就是那些。核心内容就是 A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true.  

    单问题是服务端根本没有返回 Access-Control-Allow-Origin '*' ,而是直接返回的前端页面的域名

    2017-03-27
    有用
    回复
登录 后发表内容