From 16fb4b4d63a9bac3411abb8103142152d298fedc Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Tue, 3 Oct 2023 20:42:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.0=E3=80=91=E3=80=90auth=E3=80=91?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=A3=E4=BB=A4=E6=9C=80=E5=B0=8F=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/api/expander/LoginConfigExpander.java | 13 ++++++++++++- .../V8.0.0_20231003_2036__init_login_config.sql | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/kernel-d-auth/auth-api/src/main/java/cn/stylefeng/roses/kernel/auth/api/expander/LoginConfigExpander.java b/kernel-d-auth/auth-api/src/main/java/cn/stylefeng/roses/kernel/auth/api/expander/LoginConfigExpander.java index 7a5bc92c4..afd4c8a99 100644 --- a/kernel-d-auth/auth-api/src/main/java/cn/stylefeng/roses/kernel/auth/api/expander/LoginConfigExpander.java +++ b/kernel-d-auth/auth-api/src/main/java/cn/stylefeng/roses/kernel/auth/api/expander/LoginConfigExpander.java @@ -20,7 +20,8 @@ public class LoginConfigExpander { * @since 2023/10/3 20:25 */ public static Integer getMaxErrorLoginCount() { - return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_MAX_ERROR_LOGIN_COUNT", Integer.class, LoginCacheConstants.MAX_ERROR_LOGIN_COUNT); + return ConfigContext.me() + .getSysConfigValueWithDefault("SYS_LOGIN_MAX_ERROR_LOGIN_COUNT", Integer.class, LoginCacheConstants.MAX_ERROR_LOGIN_COUNT); } /** @@ -48,4 +49,14 @@ public class LoginConfigExpander { return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_PASSWORD_RSA_VALIDATE", Boolean.class, false); } + /** + * 口令最小长度 + * + * @author fengshuonan + * @since 2023/10/3 20:39 + */ + public static Integer getMinPasswordLength() { + return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_MIN_PASSWORD_LENGTH", Integer.class, 6); + } + } diff --git a/kernel-d-auth/auth-spring-boot-starter/src/main/resources/db/migration/mysql/V8.0.0_20231003_2036__init_login_config.sql b/kernel-d-auth/auth-spring-boot-starter/src/main/resources/db/migration/mysql/V8.0.0_20231003_2036__init_login_config.sql index 2f41b2f7e..f25f6ccbd 100644 --- a/kernel-d-auth/auth-spring-boot-starter/src/main/resources/db/migration/mysql/V8.0.0_20231003_2036__init_login_config.sql +++ b/kernel-d-auth/auth-spring-boot-starter/src/main/resources/db/migration/mysql/V8.0.0_20231003_2036__init_login_config.sql @@ -1 +1,2 @@ INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709185484166533121, '密码最大重试次数', 'SYS_LOGIN_MAX_ERROR_LOGIN_COUNT', '5', 'Y', '登录账号密码登录最大的错误次数,超过此次数则冻结账号', 1, 'auth_config', 'N', '2023-10-03 20:35:49', 1339550467939639299, '2023-10-03 20:35:58', 1339550467939639299); +INSERT INTO `sys_config`(`config_id`, `config_name`, `config_code`, `config_value`, `sys_flag`, `remark`, `status_flag`, `group_code`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1709186904454336514, '口令最小长度', 'SYS_LOGIN_MIN_PASSWORD_LENGTH', '6', 'Y', NULL, 1, 'auth_config', 'N', '2023-10-03 20:41:28', 1339550467939639299, NULL, NULL);