Unverified 提交 c2d70ce8 authored 作者: Fanjc's avatar Fanjc 提交者: Gitee

PasswordEncoder 加密复杂度自定义,可在nacos中配置

Signed-off-by: 's avatarFanjc <271366833@qq.com>
上级 220d7276
...@@ -32,6 +32,12 @@ public class SecurityProperties { ...@@ -32,6 +32,12 @@ public class SecurityProperties {
@NotEmpty(message = "mock 模式的密钥不能为空") // 这里设置了一个默认值,因为实际上只有 mockEnable 为 true 时才需要配置。 @NotEmpty(message = "mock 模式的密钥不能为空") // 这里设置了一个默认值,因为实际上只有 mockEnable 为 true 时才需要配置。
private String mockSecret = "test"; private String mockSecret = "test";
/**
* PasswordEncoder 加密复杂度,越高开销越大
*/
private Integer passwordEncoderLength =4;
/** /**
* 免登录的 URL 列表 * 免登录的 URL 列表
*/ */
......
...@@ -69,7 +69,7 @@ public class YudaoSecurityAutoConfiguration { ...@@ -69,7 +69,7 @@ public class YudaoSecurityAutoConfiguration {
*/ */
@Bean @Bean
public PasswordEncoder passwordEncoder() { public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder(); return new BCryptPasswordEncoder(securityProperties.getPasswordEncoderLength());
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论