1 回答

TA贡献1860条经验 获得超9个赞
在您的配置类(实现)中使用 spring 安全约束和注销配置WebSecurityConfigurerAdapter:
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
.
...
...
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.authorizeRequests()
.antMatchers("/login*").permitAll()
.anyRequest().authenticated()
.anyRequest().authenticated()
....
.
.
.and()
.logout()
.invalidateHttpSession(true)
.deleteCookies("JSESSIONID")
}
...
...
...
}
添加回答
举报