[会写代码的健身爱好者错误记录]之Springboot升级成2.4及以上出现的跨越的问题

[会写代码的健身爱好者错误记录]之Springboot升级成2.4及以上出现的跨越的问题,第1张

[会写代码的健身爱好者错误记录]之Springboot升级成2.4及以上出现的跨越的问题

When allowCredentials is true, allowedOrigins cannot contain the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response header. To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead. 

解决很简单,要么在pom文件降低springboot版本,要么就在写跨越的方法里面

将.allowedOrigins("*")改成.allowedOriginPatterns("*")//设置允许跨域请求的域名

即可解决

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5437435.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-11
下一篇 2022-12-11

发表评论

登录后才能评论

评论列表(0条)

保存