mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-10 13:01:43 +08:00
feat: 系统配置新增安全设置功能
1、新增系统配置-安全设置CURD 2、用户个人修改密码时按照安全设置校验 3、密码连续错误账号锁定 4、密码过期判断 5、数据库数据初始化
This commit is contained in:
@@ -127,6 +127,7 @@ public class AuthController {
|
||||
UserInfoResp userInfoResp = BeanUtil.copyProperties(userDetailResp, UserInfoResp.class);
|
||||
userInfoResp.setPermissions(loginUser.getPermissions());
|
||||
userInfoResp.setRoles(loginUser.getRoleCodes());
|
||||
userInfoResp.setPasswordExpired(userService.isPasswordExpired(userDetailResp.getPwdResetTime()));
|
||||
return R.ok(userInfoResp);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.continew.admin.webapi.system;
|
||||
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import com.xkcoding.justauth.AuthRequestFactory;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -32,7 +31,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.continew.admin.common.constant.CacheConstants;
|
||||
import top.continew.admin.common.constant.RegexConstants;
|
||||
import top.continew.admin.common.enums.SocialSourceEnum;
|
||||
import top.continew.admin.common.util.SecureUtils;
|
||||
import top.continew.admin.common.util.helper.LoginHelper;
|
||||
@@ -95,8 +93,6 @@ public class UserCenterController {
|
||||
String rawNewPassword = ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(updateReq
|
||||
.getNewPassword()));
|
||||
ValidationUtils.throwIfNull(rawNewPassword, "新密码解密失败");
|
||||
ValidationUtils.throwIf(!ReUtil
|
||||
.isMatch(RegexConstants.PASSWORD, rawNewPassword), "密码长度为 6 到 32 位,可以包含字母、数字、下划线,特殊字符,同时包含字母和数字");
|
||||
userService.updatePassword(rawOldPassword, rawNewPassword, LoginHelper.getUserId());
|
||||
return R.ok("修改成功,请牢记你的新密码");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user