From 68e57803f3386ab4f5211dd30e4d8ade9d24f0a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 13 Jan 2023 22:58:11 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=80=82=E9=85=8D=20springboot-admin?= =?UTF-8?q?=20=E6=94=B9=E4=B8=BA=E6=9C=80=E6=96=B0=20spring-security=20?= =?UTF-8?q?=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/monitor/admin/config/SecurityConfig.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java b/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java index 627fa835..1115f6dc 100644 --- a/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java +++ b/ruoyi-extend/ruoyi-monitor-admin/src/main/java/com/ruoyi/monitor/admin/config/SecurityConfig.java @@ -2,6 +2,7 @@ package com.ruoyi.monitor.admin.config; import de.codecentric.boot.admin.server.config.AdminServerProperties; 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.configuration.EnableWebSecurity; import org.springframework.security.web.SecurityFilterChain; @@ -13,6 +14,7 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti * @author Lion Li */ @EnableWebSecurity +@Configuration public class SecurityConfig { private final String adminContextPath; @@ -29,8 +31,8 @@ public class SecurityConfig { return httpSecurity .headers().frameOptions().disable() - .and().authorizeRequests() - .antMatchers(adminContextPath + "/assets/**" + .and().authorizeHttpRequests() + .requestMatchers(adminContextPath + "/assets/**" , adminContextPath + "/login" , "/actuator" , "/actuator/**"