|
|
|
@ -262,11 +262,14 @@ public class SysUserPasswordUtil {
|
|
|
|
|
int num = RedisCacheTool.getSysConfigIntVal(CommonConstWords.CONFIG_PWD_REPEAT_DAY, CommonConstWords.CONFIG_PWD_REPEAT_DAY_DEFAULT);
|
|
|
|
|
if (num > 0) {
|
|
|
|
|
try {
|
|
|
|
|
SysUserPassword userPassword = new SysUserPassword();
|
|
|
|
|
userPassword.setUserId(user.getId());
|
|
|
|
|
userPassword.setUserPassword(EncryptTool.hexMD5(user.getUserLoginPassword()));
|
|
|
|
|
// SysUserPassword userPassword = new SysUserPassword();
|
|
|
|
|
// userPassword.setUserId(user.getId());
|
|
|
|
|
// userPassword.setUserPassword(EncryptTool.hexMD5(user.getUserLoginPassword()));
|
|
|
|
|
|
|
|
|
|
List<SysUserPassword> passwords = userPasswordService.findAllByBean(userPassword);
|
|
|
|
|
// List<SysUserPassword> passwords = userPasswordService.findAllByBean(userPassword);
|
|
|
|
|
|
|
|
|
|
//todo: 如果密码数据太多可以考虑建立以Creat eDatetime 相关的索引,ORDER BY create_date_time DESC ,查出最近的一条就行
|
|
|
|
|
List<SysUserPassword> passwords = userPasswordService.findPasswordByPassword(EncryptTool.hexMD5(user.getUserLoginPassword()));
|
|
|
|
|
|
|
|
|
|
int lastDay = Integer.MAX_VALUE;
|
|
|
|
|
if (CollectionUtils.isNotEmpty(passwords)) {
|
|
|
|
@ -279,9 +282,7 @@ public class SysUserPasswordUtil {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lastDay > num) {
|
|
|
|
|
if (num > lastDay) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
@ -289,6 +290,16 @@ public class SysUserPasswordUtil {
|
|
|
|
|
.setErrorSolution("请重新输入")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (lastDay > num) {
|
|
|
|
|
// throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
// .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
// .setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
|
// .setErrorDetail("请勿使用重复密码")
|
|
|
|
|
// .setErrorSolution("请重新输入")
|
|
|
|
|
// .build();
|
|
|
|
|
// }
|
|
|
|
|
} catch (ImppBusiException e) {
|
|
|
|
|
throw e;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|