From 5b883298571421132edf68cab7a22ab16a1f0a6b Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期四, 11 九月 2025 17:32:47 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/haizhentong

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
index 5c53a61..c89d935 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
@@ -62,16 +62,22 @@
     @Autowired
     private ISysMenuService menuService;
 
-    @PreAuthorize("@ss.hasPermi('system:role')")
+//    @PreAuthorize("@ss.hasPermi('system:role')")
     @ApiOperation(value = "角色列表")
     @PostMapping("/list")
     public AjaxResult list(@RequestBody SysRoleQuery query)
     {
+
+        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
+        if(roleType == 1 || roleType == 4 || roleType == 5){
+            query.setRoleType(roleType);
+        }
+
         PageInfo<SysRole> list = roleService.selectPageList(query);
         return AjaxResult.success(list);
     }
 
-    @PreAuthorize("@ss.hasPermi('system:role')")
+//    @PreAuthorize("@ss.hasPermi('system:role')")
     @ApiOperation(value = "角色列表不分页")
     @PostMapping("/listNotPage")
     public AjaxResult list()
@@ -94,16 +100,6 @@
         map.put("stop",stop);
         return AjaxResult.success(map);
     }
-
-//    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
-//    // @PreAuthorize("@ss.hasPermi('system:role:export')")
-//    @PostMapping("/export")
-//    public void export(HttpServletResponse response, SysRole role)
-//    {
-//        List<SysRole> list = roleService.selectRoleList(role);
-//        ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
-//        util.exportExcel(response, list, "角色数据");
-//    }
 
     /**
      * 根据角色编号获取详细信息
@@ -152,7 +148,7 @@
     /**
      * 新增角色
      */
-     @PreAuthorize("@ss.hasPermi('system:role:add')")
+//     @PreAuthorize("@ss.hasPermi('system:role:add')")
     @ApiOperation(value = "新增角色")
     @Log(title = "角色信息-新增角色", businessType = BusinessType.INSERT)
     @PostMapping("/add")
@@ -162,6 +158,8 @@
         if(flag){
             return error("新增角色'" + dto.getRoleName() + "'失败,角色名称已存在");
         }
+        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
+        dto.setRoleType(roleType);
         roleService.saveRole(dto);
         return AjaxResult.success();
 
@@ -170,7 +168,7 @@
     /**
      * 修改保存角色
      */
-     @PreAuthorize("@ss.hasPermi('system:role:edit')")
+//     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @ApiOperation(value = "编辑角色")
     @Log(title = "角色信息-编辑角色", businessType = BusinessType.UPDATE)
     @PutMapping

--
Gitblit v1.7.1