前言
报错:
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.
原因:springboot升级2.6.0后所出现的问题
解决方法:将.allowedOrigins 替换成. allowedOriginPatterns 即可。
如下图:
ps:这是2.3时代的配置,现在不叫这个了,要用: