update 适配 springboot-admin 改为最新 spring-security 写法

feature/model
疯狂的狮子Li 2 years ago
parent 25f89bd236
commit 68e57803f3

@ -2,6 +2,7 @@ package com.ruoyi.monitor.admin.config;
import de.codecentric.boot.admin.server.config.AdminServerProperties; import de.codecentric.boot.admin.server.config.AdminServerProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.SecurityFilterChain;
@ -13,6 +14,7 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti
* @author Lion Li * @author Lion Li
*/ */
@EnableWebSecurity @EnableWebSecurity
@Configuration
public class SecurityConfig { public class SecurityConfig {
private final String adminContextPath; private final String adminContextPath;
@ -29,8 +31,8 @@ public class SecurityConfig {
return httpSecurity return httpSecurity
.headers().frameOptions().disable() .headers().frameOptions().disable()
.and().authorizeRequests() .and().authorizeHttpRequests()
.antMatchers(adminContextPath + "/assets/**" .requestMatchers(adminContextPath + "/assets/**"
, adminContextPath + "/login" , adminContextPath + "/login"
, "/actuator" , "/actuator"
, "/actuator/**" , "/actuator/**"

Loading…
Cancel
Save