nodejs 跨域出现错误

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/github_35631540/article/details/80765963

错误日志如下:

Failed to load http://115.159.52.223:3000/user/admin-userLogin: 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'. Origin 'http://192.168.16.220:8000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.


服务端编写如下:


原因为 使用axios 发起请求时 配置了参数

withCredentials: true,

去掉即可

猜你喜欢

转载自blog.csdn.net/github_35631540/article/details/80765963