问答详情
源自:3-11 用户模型管理--用户注册功能实现02

这样设置报错 @CrossOrigin(allowCredentials = "true", allowedHeaders = "*")

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.

不知道怎么改

把allowedHeaders 改成 allowedOriginPatterns 不行的

提问者:dijkstra___0 2021-07-29 20:53

个回答

  • 心态超好
    2022-03-06 20:20:59

    @CrossOrigin(origins = {" * "}, allowedHeaders="*")


  • 加油_1
    2021-08-16 11:27:06

    @CrossOrigin(originPatterns = "*",allowCredentials = "true",allowedHeaders = "*")