From fc11e8c32d8aa56b9eee8d1a568238b660a572fb Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Thu, 5 Oct 2023 17:19:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.0.1=E3=80=91=E3=80=90system=E3=80=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E7=9A=84=E7=9B=90=E5=80=BC?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/sys/api/SecurityConfigService.java | 8 ++++++++ .../service/impl/SecurityConfigServiceImpl.java | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/SecurityConfigService.java b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/SecurityConfigService.java index 5b67e1661..d97c46454 100644 --- a/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/SecurityConfigService.java +++ b/kernel-s-system/system-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/SecurityConfigService.java @@ -36,4 +36,12 @@ public interface SecurityConfigService { */ void validatePasswordSecurityRule(boolean updatePasswordFlag, String password); + /** + * 记录用户密码修改的日志 + * + * @author fengshuonan + * @since 2023/10/5 17:16 + */ + void recordPasswordEditLog(Long userId, String md5, String salt); + } diff --git a/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/security/service/impl/SecurityConfigServiceImpl.java b/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/security/service/impl/SecurityConfigServiceImpl.java index 277c21ea7..dd7c6c5c3 100644 --- a/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/security/service/impl/SecurityConfigServiceImpl.java +++ b/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/security/service/impl/SecurityConfigServiceImpl.java @@ -6,9 +6,12 @@ import cn.stylefeng.roses.kernel.sys.api.SecurityConfigService; import cn.stylefeng.roses.kernel.sys.api.exception.SysException; import cn.stylefeng.roses.kernel.sys.api.exception.enums.SecurityStrategyExceptionEnum; import cn.stylefeng.roses.kernel.sys.api.pojo.security.SecurityConfig; +import cn.stylefeng.roses.kernel.sys.modular.security.entity.SysUserPasswordRecord; +import cn.stylefeng.roses.kernel.sys.modular.security.service.SysUserPasswordRecordService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Date; /** * 系统配置的业务 @@ -22,6 +25,9 @@ public class SecurityConfigServiceImpl implements SecurityConfigService { @Resource private ConfigServiceApi configServiceApi; + @Resource + private SysUserPasswordRecordService sysUserPasswordRecordService; + @Override public SecurityConfig getSecurityConfig() { @@ -132,5 +138,15 @@ public class SecurityConfigServiceImpl implements SecurityConfigService { } + @Override + public void recordPasswordEditLog(Long userId, String md5, String salt) { + SysUserPasswordRecord sysUserPasswordRecord = new SysUserPasswordRecord(); + sysUserPasswordRecord.setUserId(userId); + sysUserPasswordRecord.setHistoryPassword(md5); + sysUserPasswordRecord.setHistoryPasswordSalt(salt); + sysUserPasswordRecord.setUpdatePasswordTime(new Date()); + this.sysUserPasswordRecordService.save(sysUserPasswordRecord); + } + }