微服务监控中心springboot-admin 配置登录密码
2023-03-31 11:06:30 时间
1. pom 加入 security
<!-- 加入密码认证 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
2. 加入配置类 SecuritySecureConfig
package org.fh.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import de.codecentric.boot.admin.server.config.AdminServerProperties;
/**
* 说明:SecuritySecure配置
* 作者:FH Admin
* from:fhadmin.cn
*/
@Configuration
public class SecuritySecureConfig extends WebSecurityConfigurerAdapter {
private final String adminContextPath;
public SecuritySecureConfig(AdminServerProperties adminServerProperties) {
this.adminContextPath = adminServerProperties.getContextPath();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
successHandler.setTargetUrlParameter("redirectTo");
http.headers().frameOptions().disable();
http.authorizeRequests().antMatchers(adminContextPath + "/assets/**",adminContextPath + "/actuator/**").permitAll()
.antMatchers(adminContextPath + "/login").permitAll().anyRequest().authenticated().and().formLogin()
.loginPage(adminContextPath + "/login").successHandler(successHandler).and().logout()
.logoutUrl(adminContextPath + "/logout").and().httpBasic().and().csrf().disable();
}
}
3. 配置 application.properties
#开启安全认证 用户名和密码
spring.security.user.name=fhadmin
spring.security.user.password=root
spring.security.basic.enabled=true
-----------------------------------------------------------------自定义表单
28. 定义模版:拖拽左侧表单元素到右侧区域,编辑表单元素,保存表单模版
29. 表单模版:编辑维护表单模版,复制表单模版,修改模版类型,预览表单模版
30. 我的表单:选择表单模版,编辑表单规则,是否上传图片、附件、开启富文本、挂靠流程开关等
31. 表单数据:从我的表单进去可增删改查表单数据,修改表单规则
32. 挂靠记录:记录表单数据和流程实例ID关联记录,可删除
相关文章
- 小谈C#异常
- ETL详细安装教程(常见错误)
- contains an expression but should be a constant
- Spring boot 内部服务调用 (FeignClient)
- ETL(七):存储过程转换器和序列转换器的使用
- UmiJS less文件热更新报错:punycode.toASCII is not a function
- Qt Quick中PySide2使用qrc文件
- Kubernetes 之“服务发现”解析
- Excel动态图制作
- numpy中生成随机数的几种常用函数
- numpy的使用说明(六):一招帮你彻底搞懂axis=0和axis=1
- 进程注入 OPSEC tips
- numpy的使用说明(五):数组的广播机制、数组元素的底层存储
- 管脚约束问题导致生成bit时报错 如何在不重新Implentation情况下生成bit?
- numpy的使用说明(二):这一章设计很多重要知识点(必看)
- Xilinx Ethernet MAC IP调试的小坑
- Xilinx FPGA的DNA是什么?
- false path和asynchronous的区别
- TIA基本过程库(LBP)
- 聊聊自定义SPI如何使用自定义标签注入到spring容器中