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

@CrossOrigin

我的

@CrossOrigin

注解只要加了后面的两个参数springboot都启动不起来

 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

提问者:qq_慕仙2069110 2020-12-17 17:49

个回答

  • qq_安静_77
    2021-10-22 01:06:10

    // spring boot 版本用2.1 

    @RequestParam(name = "otpCode") String otpCode // otpCode 字母要一致

  • qq_慕仙2069110
    2020-12-18 10:36:12

    http://img2.mukewang.com/5fdc15110001b7eb09340082.jpg

    我百度了,是spring2.4的问题,allowCreadentials 为 true不允许后面的设置* 我把spring换成2.0那个版本就好了,不过还是谢谢你,感谢

  • weixin_慕斯6330653
    2020-12-18 08:55:31

    贴一下你@CrossOrign的注解看看,或者你改成下面这种方式试试(每个controller都加上这种注解)

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