SpringApplication.run(BootAdminServerApplication.class, args);
}
}
4、配置security安全信息
在application.properties文件中新增以下配置信息。
应用程序端口
server.port=8085
配置一个账号和密码
spring.security.user.name=admin
spring.security.user.password=admin
初始化SecuritySecureConfig配置(如未初始化是看不到带SpringBootAdmin Logo登录页面的)
@Configuration
public static class SecuritySecureConfig extends WebSecurityConfigurerAdapter {
private final String adminContextPath;
public SecuritySecureConfig(AdminServerProperties adminServerProperties) {
this.adminContextPath = adminServerProperties.getContextPath();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwar