qq_慕仙2069110
2020-12-17 17:49
我的
@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
// spring boot 版本用2.1
@RequestParam(name = "otpCode") String otpCode // otpCode 字母要一致
我百度了,是spring2.4的问题,allowCreadentials 为 true不允许后面的设置* 我把spring换成2.0那个版本就好了,不过还是谢谢你,感谢
贴一下你@CrossOrign的注解看看,或者你改成下面这种方式试试(每个controller都加上这种注解)
@CrossOrigin(allowCredentials = "true",origins = "*")
SpringBoot构建电商基础秒杀项目
49065 学习 · 954 问题
相似问题