mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-27 20:21:56 +08:00
添加google-style 格式化maven插件,fix utf8文件编码问题
This commit is contained in:
@@ -1,30 +1,29 @@
|
||||
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)
|
||||
{
|
||||
SpringApplication.run(RuoYiMonitorApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 监控中心启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
public class RuoYiMonitorApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(RuoYiMonitorApplication.class, args);
|
||||
System.out.println(
|
||||
"(♥◠‿◠)ノ゙ 监控中心启动成功 ლ(´ڡ`ლ)゙ \n"
|
||||
+ " .-------. ____ __ \n"
|
||||
+ " | _ _ \\ \\ \\ / / \n"
|
||||
+ " | ( ' ) | \\ _. / ' \n"
|
||||
+ " |(_ o _) / _( )_ .' \n"
|
||||
+ " | (_,_).' __ ___(_ o _)' \n"
|
||||
+ " | |\\ \\ | || |(_,_)' \n"
|
||||
+ " | | \\ `' /| `-' / \n"
|
||||
+ " | | \\ / \\ / \n"
|
||||
+ " ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,43 +9,50 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti
|
||||
|
||||
/**
|
||||
* 监控权限配置
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableWebSecurity
|
||||
public class WebSecurityConfigurer
|
||||
{
|
||||
private final String adminContextPath;
|
||||
public class WebSecurityConfigurer {
|
||||
private final String adminContextPath;
|
||||
|
||||
public WebSecurityConfigurer(AdminServerProperties adminServerProperties)
|
||||
{
|
||||
this.adminContextPath = adminServerProperties.getContextPath();
|
||||
}
|
||||
public WebSecurityConfigurer(AdminServerProperties adminServerProperties) {
|
||||
this.adminContextPath = adminServerProperties.getContextPath();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception
|
||||
{
|
||||
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
||||
successHandler.setTargetUrlParameter("redirectTo");
|
||||
successHandler.setDefaultTargetUrl(adminContextPath + "/");
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
|
||||
SavedRequestAwareAuthenticationSuccessHandler successHandler =
|
||||
new SavedRequestAwareAuthenticationSuccessHandler();
|
||||
successHandler.setTargetUrlParameter("redirectTo");
|
||||
successHandler.setDefaultTargetUrl(adminContextPath + "/");
|
||||
|
||||
return httpSecurity
|
||||
.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()
|
||||
.build();
|
||||
}
|
||||
return httpSecurity
|
||||
.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()
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user