引入依赖spring-boot-starter-security 之后, 默认开启权限验证, 访问返回401,实际开发阶段需要暂时关闭权限验证.
启动类排除SecurityAutoConfiguration.class
@SpringBootApplication(exclude ={SecurityAutoConfiguration.class})
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class,args);
}
}