fix: 修改包名,模块名。

This commit is contained in:
tianyongbao
2025-01-15 22:06:44 +08:00
parent 47ca61ec9e
commit 96f4c874d9
874 changed files with 3328 additions and 5344 deletions

View File

@@ -0,0 +1,44 @@
package com.intc.system.config;
import com.intc.common.core.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;
/**
* @ClassName ActuatorSecurityConfig
* @Author YaphetS
* @Date 2023/3/14 9:18
* @Version 1.0
* @Description TODO
*/
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class ActuatorSecurityConfig {
@Autowired
Environment env;
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
String contextPath = env.getProperty("management.endpoints.web.base-path");
if(StringUtils.isEmpty(contextPath)) {
contextPath = "/actuator";
}
http.csrf().disable();
http.authorizeRequests()
.antMatchers("/**"+contextPath+"/**")
.authenticated()
.anyRequest()
.permitAll()
.and()
.httpBasic();
return http.build();
}
}