From 0abccf5e570dce53a802bca4ce25118dd900692c Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期五, 23 二月 2024 14:07:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
index b0bbc08..d81d647 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -6,6 +6,7 @@
 
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
+import com.ruoyi.utils.result.Results;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -62,7 +63,7 @@
      * 鑾峰彇鐢ㄦ埛鍒楄〃
      */
     @ApiOperation("鑾峰彇鐢ㄦ埛鍒楄〃")
-    @PreAuthorize("@ss.hasPermi('system:user:list')")
+//    @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysUser user) {
         startPage();
@@ -142,7 +143,7 @@
     /**
      * 淇敼鐢ㄦ埛
      */
-
+    @ApiOperation("淇敼鐢ㄦ埛")
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.UPDATE)
     @PutMapping
@@ -237,4 +238,32 @@
     public AjaxResult deptTree(SysDept dept) {
         return success(deptService.selectDeptTreeList(dept));
     }
+    /**
+     * 鑾峰彇閮ㄩ棬鏍戝垪琛�
+     */
+    @GetMapping("/deptTree/noPerm")
+    public AjaxResult deptTreeNoPerm(SysDept dept) {
+        return success(deptService.selectDeptTreeList(dept));
+    }
+    /**
+     * 淇敼瀵嗙爜
+     */
+    @ApiOperation("淇敼瀵嗙爜")
+//    @PreAuthorize("@ss.hasPermi('system:user:changePwd')")
+    @PutMapping("/changePwd")
+    public Results changePwd(String newPassword) {
+        String userId = SecurityUtils.getUserId();
+        SysUser sysUser = userService.selectUserById(userId);
+        userService.checkUserAllowed(sysUser);
+        userService.checkUserDataScope(userId);
+        sysUser.setPassword(SecurityUtils.encryptPassword(newPassword));
+        sysUser.setUpdateBy(getUsername());
+        int num = userService.resetPwd(sysUser);
+        if(num == 0){
+            return Results.error("淇敼瀵嗙爜澶辫触锛�");
+        }else {
+            return Results.succeed("淇敼瀵嗙爜鎴愬姛锛�");
+        }
+    }
+
 }

--
Gitblit v1.9.3