nodejs 跨域出现错误
【摘要】
错误日志如下:
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 '*...
错误日志如下:
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,
去掉即可
文章来源: fizzz.blog.csdn.net,作者:拿我格子衫来,版权归原作者所有,如需转载,请联系作者。
原文链接:fizzz.blog.csdn.net/article/details/80765963
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)