From 073d2fa1d86fcb998bc27e79cdc3773da7ed8b2b Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期二, 10 三月 2026 16:37:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/yagwly_fa_master' into yagwly_fa_master
---
admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
index c0b00d0..dae025b 100644
--- a/admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
+++ b/admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -3,6 +3,10 @@
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.constant.CacheConstants;
+import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.Sm4Utils;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -53,6 +57,8 @@
@Autowired
private ISysPostService postService;
+ @Autowired
+ RedisCache redisCache;
/**
* 鑾峰彇鐢ㄦ埛鍒楄〃
*/
@@ -138,6 +144,13 @@
{
return error("鏂板鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛岄偖绠辫处鍙峰凡瀛樺湪");
}
+ if (user.getIsDriver() == 0 && !userService.checkDriverUnique(user)){
+ return error("鏂板鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛岄┚椹跺憳宸茬粦瀹氬叾浠栬处鎴�");
+
+ }else{
+ user.setDriverId(null);
+ }
+
user.setCreateBy(getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user));
@@ -167,6 +180,11 @@
{
return error("淇敼鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛岄偖绠辫处鍙峰凡瀛樺湪");
}
+ if (user.getIsDriver() == 0 && !userService.checkDriverUnique(user)){
+ return error("鏂板鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛岄┚椹跺憳宸茬粦瀹氬叾浠栬处鎴�");
+
+ }
+
user.setUpdateBy(getUsername());
return toAjax(userService.updateUser(user));
}
@@ -196,6 +214,7 @@
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
+ user.setPassword(Sm4Utils.decryptSm4(user.getPassword())) ;
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
user.setUpdateBy(getUsername());
return toAjax(userService.resetPwd(user));
@@ -230,6 +249,15 @@
return ajax;
}
+
+ @PreAuthorize("@ss.hasPermi('system:user:edit')")
+ @GetMapping("/unLockUser/{userName}")
+ public AjaxResult unLockUser(@PathVariable("userName") String userName)
+ {
+ redisCache.deleteObject(CacheConstants.PWD_ERR_CNT_KEY + userName);
+ return AjaxResult.success();
+ }
+
/**
* 鐢ㄦ埛鎺堟潈瑙掕壊
*/
--
Gitblit v1.8.0