Skip to content

Commit c19ca70

Browse files
committed
删除Logging Admin示例中的相关Spring Security配置
1 parent 2f5dfb8 commit c19ca70

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

api-boot-samples/api-boot-sample-logging-admin/src/main/java/org/minbox/framework/api/boot/sample/logging/admin/ApiBootLoggingAdminApplication.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
import org.slf4j.LoggerFactory;
2222
import org.springframework.boot.SpringApplication;
2323
import org.springframework.boot.autoconfigure.SpringBootApplication;
24-
import org.springframework.context.annotation.Configuration;
25-
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
26-
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
27-
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
2824

2925
/**
3026
* @author:恒宇少年 - 于起宇
@@ -46,23 +42,4 @@ public static void main(String[] args) {
4642
SpringApplication.run(ApiBootLoggingAdminApplication.class, args);
4743
logger.info("{}服务启动成功.", "");
4844
}
49-
50-
@Configuration
51-
public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
52-
53-
@Override
54-
protected void configure(HttpSecurity http) throws Exception {
55-
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
56-
successHandler.setTargetUrlParameter("redirectTo");
57-
http.authorizeRequests()
58-
.antMatchers("/assets/**").permitAll()
59-
.antMatchers("/login").permitAll()
60-
.anyRequest().authenticated()
61-
.and()
62-
.formLogin().loginPage("/login").successHandler(successHandler).and()
63-
.logout().and()
64-
.httpBasic().and()
65-
.csrf().disable();
66-
}
67-
}
6845
}

api-boot-samples/api-boot-sample-logging-admin/src/main/resources/application.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ api:
2323
# 显示上报日志
2424
show-console-report-log: true
2525
# 格式化上报日志
26-
format-console-log-json: true
27-
cache-templates: false
26+
format-console-log-json: true

0 commit comments

Comments
 (0)