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

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

CrossOrigin注解加上这两个参数,会报以下的错误:

When allowCredentials is true, allowedOrigins cannot contain the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response header

提问者:Bec_3 2021-09-25 22:55

个回答

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

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


  • qq_不闻不问不听不看不在乎_0
    2022-02-26 19:34:03

    添加

    originPatterns = "*"