long类型的方法参数缺少uri模板变量“id” 问题出现的原因是使用@PathVariable注解而没有采用rest的写法 如图所示: 解决思路:加上 @RequestMapping("/ban/{userId}")