mirror of https://gitee.com/stylefeng/roses
【8.0.1】【system】更新接口,增加修改密码的盐值记录日志
parent
08c1d34256
commit
fc11e8c32d
|
@ -36,4 +36,12 @@ public interface SecurityConfigService {
|
||||||
*/
|
*/
|
||||||
void validatePasswordSecurityRule(boolean updatePasswordFlag, String password);
|
void validatePasswordSecurityRule(boolean updatePasswordFlag, String password);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录用户密码修改的日志
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/10/5 17:16
|
||||||
|
*/
|
||||||
|
void recordPasswordEditLog(Long userId, String md5, String salt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.SysException;
|
||||||
import cn.stylefeng.roses.kernel.sys.api.exception.enums.SecurityStrategyExceptionEnum;
|
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.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 org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统配置的业务
|
* 系统配置的业务
|
||||||
|
@ -22,6 +25,9 @@ public class SecurityConfigServiceImpl implements SecurityConfigService {
|
||||||
@Resource
|
@Resource
|
||||||
private ConfigServiceApi configServiceApi;
|
private ConfigServiceApi configServiceApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysUserPasswordRecordService sysUserPasswordRecordService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SecurityConfig getSecurityConfig() {
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue