Spring boot配置全局跨域未生效,访问接口报错

问题描述

java.lang.IllegalArgumentException: 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.

解决办法

错误是因为Spring boot版本过高,从而导致跨域未生效,我使用的是2.4.0报错,修改为2.3.0.RELEASE版本问题得到解决。

 


版权声明:本文为Flying_6原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。