📜  在登录视图中添加图像 Spring Boot Security - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:26.108000             🧑  作者: Mango

代码示例1
@Override
protected void configure(HttpSecurity http) throws Exception {

    String[] staticResources  =  {
        "/css/**",
        "/images/**",
        "/fonts/**",
        "/scripts/**",
    };

    http
        .authorizeRequests()
            .antMatchers(staticResources).permitAll()
            .anyRequest().authenticated()
            .and()
        .formLogin()
            .loginPage("/login").permitAll()
            .and()
        .logout().permitAll();
}