欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

跨域问题解决

程序员文章站 2023-11-22 08:12:40
has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's ......

has been blocked by cors policy: 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

这个错误是由于同时设置了 access-control-allow-origin=* 和 access-control-allow-credentials=true

解决办法是把*改为指定地址