问题复现:
Controller里的方法:
@GetMapping("/act-list")
public Result getCompetitionList(@RequestParam("class") int cclass, @RequestParam int type, @RequestParam int begin, @RequestParam int limit){
...
}
发送请求:
http://localhost:8887/act-list?class=1&type=1&begin=0&limit=2
发现服务端接收的type始终为1
去postman中查看请求:
可见@RequestParam优先匹配请求体里的参数,而不是请求头的,删掉请求体里的参数问题解决