81,092
社区成员
发帖
与我相关
我的任务
分享
@Override
protected void configure(HttpSecurity http) throws Exception {
// super.configure(http);
http
.authorizeRequests()
.antMatchers("/", "/test1", "/test2", "/login", "/register/**", "/webjars/**").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll()
// .failureUrl("login?error=true")
.successHandler(new MySuccessHandler())
.defaultSuccessUrl("/admin/index")
.and()
.logout()
.logoutSuccessUrl("/")
.and()
// .csrf().disable()
.rememberMe()
;
http.addFilterAfter(myFilterSecurityInterceptor, FilterSecurityInterceptor.class);
}