关于axios:跨域-跨域报错

39次阅读

共计 289 个字符,预计需要花费 1 分钟才能阅读完成。

报错蕴含:: The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘*’ when the request’s credentials mode is ‘include’. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

解决办法:
axios.defaults.withCredentials = false;
(把 ture 改为 false 即可)

正文完
 0