zl程序教程

您现在的位置是:首页 >  后端

当前栏目

【异常】跨域问题header in the response must not be the wildcard ‘*‘ when the request‘s credentials modeis

异常跨域 in The not be request must
2023-09-14 09:04:54 时间

一、异常内容

使用了Java前后端分离项目(Logan框架),前端Axios发送跨域请求时,Chrome提示了报错如下

Access to XMLHttpRequest at 
'http://localhost:3000/luckylog/luckylog/latest.json' from origin 
'http://localhost:30000' 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.

在这里插入图片描述