1. 在Application类中加上 @ComponentScan(basePackages = {"com.demo.controller"}) 多个之间用","分隔 当然,这样治标不治本 2.修改正确的目录结构