在启动项注解中增加即可: org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
/**
* 启动程序
*
* @author soundai
*/
@EnableApolloConfig
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class})
public class VaccineAdminApplication {
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext application =
SpringApplication.run(VaccineAdminApplication.class, args);
System.out.println("============================================= 启动成功!========================================");
Environment env = application.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = env.getProperty("server.servlet.context-path");
System.out.println("\n----------------------------------------------------------\n" +
"Application vaccine-admin-api is running! Access URLs:\n" +
"External: http://" + ip + ":" + port + path + "\n" +
"----------------------------------------------------------");
}
}