文章来自:源码在线https://www.shengli.me/javascript/287.html

 

1、假如访问的接口地址为 http://www.test.com/apis/index.php  (php api 接口)

2、而开发地址为http://127.0.0.1:8080,当axios发起请求时,出现如下错误:

Failed to load http://www.test.com/apis/index.php?&act=login: The value of the 'Access-Control-Allow-Origin' headerin the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://127.0.0.1:8080' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

 

axios跨域访问错误(vue.js)

axios跨域访问错误(vue.js) 

相关文章:

  • 2021-08-16
  • 2021-06-10
  • 2021-09-24
  • 2020-04-11
  • 2021-11-16
  • 2021-07-12
  • 2022-12-23
猜你喜欢
  • 2018-11-20
  • 2022-12-23
  • 2021-05-07
  • 2021-08-18
  • 2021-12-23
相关资源
相似解决方案