mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	fix 修复 监控代码报错问题
This commit is contained in:
		@@ -3,7 +3,6 @@ package org.dromara.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.context.annotation.Scope;
 | 
			
		||||
import org.springframework.security.config.Customizer;
 | 
			
		||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
 | 
			
		||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
 | 
			
		||||
@@ -11,9 +10,7 @@ import org.springframework.security.config.annotation.web.configurers.AbstractHt
 | 
			
		||||
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer;
 | 
			
		||||
import org.springframework.security.web.SecurityFilterChain;
 | 
			
		||||
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
 | 
			
		||||
import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
 | 
			
		||||
import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher;
 | 
			
		||||
import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * admin 监控 安全配置
 | 
			
		||||
@@ -31,11 +28,11 @@ public class SecurityConfig {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Bean
 | 
			
		||||
    public SecurityFilterChain filterChain(HttpSecurity httpSecurity, PathPatternRequestMatcher.Builder mvc) throws Exception {
 | 
			
		||||
    public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
 | 
			
		||||
        SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
 | 
			
		||||
        successHandler.setTargetUrlParameter("redirectTo");
 | 
			
		||||
        successHandler.setDefaultTargetUrl(adminContextPath + "/");
 | 
			
		||||
 | 
			
		||||
        PathPatternRequestMatcher.Builder mvc = PathPatternRequestMatcher.withDefaults();
 | 
			
		||||
        return httpSecurity
 | 
			
		||||
            .headers((header) ->
 | 
			
		||||
                header.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable))
 | 
			
		||||
@@ -54,10 +51,4 @@ public class SecurityConfig {
 | 
			
		||||
            .build();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Scope("prototype")
 | 
			
		||||
    @Bean
 | 
			
		||||
    public MvcRequestMatcher.Builder mvc(HandlerMappingIntrospector introspector) {
 | 
			
		||||
        return new MvcRequestMatcher.Builder(introspector);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user