需要在启动类的注解里加上exclude = SecurityAutoConfiguration.class @SpringBootApplication(exclude = SecurityAutoConfiguration.class)