报错原文:
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.
这里已经说了使用allowedOriginPatterns
这个方法,所有我们在原来的代码上把setAllowedOrigins
改用成allowedOriginPatterns
即可。