Commit 03229683 by qiuchaofei

1.放开/actuator/的访问

parent 5c7a33db
...@@ -184,6 +184,12 @@ ...@@ -184,6 +184,12 @@
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
...@@ -36,7 +36,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -36,7 +36,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
if (permit) if (permit)
http.httpBasic().and().authorizeRequests().anyRequest().permitAll(); http.httpBasic().and().authorizeRequests().anyRequest().permitAll();
else { else {
http.httpBasic().and().authorizeRequests().anyRequest().authenticated(); http.httpBasic().and()
.authorizeRequests().antMatchers("/actuator/**").permitAll().and()
.authorizeRequests().anyRequest().authenticated();
} }
http.csrf().disable(); http.csrf().disable();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment