联调环境新起的 admin 前端,登录按钮点下去没反应,控制台一行红字: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'。
后端图省事写的 Access-Control-Allow-Origin: *,前端 fet...
前后端分离的项目,前端跑在 localhost:5173,接口域名是 api.example.com。带 Authorization 头的 POST 一发出,控制台就是一句 Response to preflight request does not have HTTP ok status,Network 里那条 OPTIONS 是 403。
点开响应,返回的是 nginx 的 403 页面,不是应用里的 JSON,说明请求压根没进到后端。后端其实配了 C...