这是代码,我用的spring boot
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true) // 开启security注解a
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/", "/hello").permitAll()
.anyRequest()
.authenticated()
.and().
formLogin()
.usernameParameter("username")
.passwordParameter("password")
.loginProcessingUrl("/login")
.loginPage("/login")
.defaultSuccessUrl("/hello");
}
可是这个配置,没有启用,还spring 的默认登录框,怎么弄啊?