mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-11-28 01:00:05 +08:00
全项目代码格式化
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
package com.ruoyi.modules.monitor;
|
||||
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
||||
|
||||
/**
|
||||
* 监控中心
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableAdminServer
|
||||
@SpringBootApplication
|
||||
public class RuoYiMonitorApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
public class RuoYiMonitorApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(RuoYiMonitorApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 监控中心启动成功 ლ(´ڡ`ლ)゙ ");
|
||||
}
|
||||
|
||||
@@ -8,42 +8,39 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti
|
||||
|
||||
/**
|
||||
* 监控权限配置
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter
|
||||
{
|
||||
public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
|
||||
private final String adminContextPath;
|
||||
|
||||
public WebSecurityConfigurer(AdminServerProperties adminServerProperties)
|
||||
{
|
||||
public WebSecurityConfigurer(AdminServerProperties adminServerProperties) {
|
||||
this.adminContextPath = adminServerProperties.getContextPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception
|
||||
{
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
||||
successHandler.setTargetUrlParameter("redirectTo");
|
||||
successHandler.setDefaultTargetUrl(adminContextPath + "/");
|
||||
|
||||
http
|
||||
.headers().frameOptions().disable()
|
||||
.and().authorizeRequests()
|
||||
.antMatchers(adminContextPath + "/assets/**"
|
||||
, adminContextPath + "/login"
|
||||
, adminContextPath + "/actuator/**"
|
||||
, adminContextPath + "/instances/**"
|
||||
).permitAll()
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
.formLogin().loginPage(adminContextPath + "/login")
|
||||
.successHandler(successHandler).and()
|
||||
.logout().logoutUrl(adminContextPath + "/logout")
|
||||
.and()
|
||||
.httpBasic().and()
|
||||
.csrf()
|
||||
.disable();
|
||||
.headers().frameOptions().disable()
|
||||
.and().authorizeRequests()
|
||||
.antMatchers(adminContextPath + "/assets/**"
|
||||
, adminContextPath + "/login"
|
||||
, adminContextPath + "/actuator/**"
|
||||
, adminContextPath + "/instances/**"
|
||||
).permitAll()
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
.formLogin().loginPage(adminContextPath + "/login")
|
||||
.successHandler(successHandler).and()
|
||||
.logout().logoutUrl(adminContextPath + "/logout")
|
||||
.and()
|
||||
.httpBasic().and()
|
||||
.csrf()
|
||||
.disable();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user