From 1e2dc58adc5bdf7b17b3f75eefc55a1aa914b6cf Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 10 四月 2025 11:44:03 +0800
Subject: [PATCH] bug修改
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 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 fa44b77..5c53a61 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
@@ -15,6 +15,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
@@ -61,15 +62,16 @@
@Autowired
private ISysMenuService menuService;
- // @PreAuthorize("@ss.hasPermi('system:role:list')")
+ @PreAuthorize("@ss.hasPermi('system:role')")
@ApiOperation(value = "角色列表")
@PostMapping("/list")
public AjaxResult list(@RequestBody SysRoleQuery query)
{
- PageInfo<SysRole> list = roleService.selectList(query);
+ PageInfo<SysRole> list = roleService.selectPageList(query);
return AjaxResult.success(list);
}
+ @PreAuthorize("@ss.hasPermi('system:role')")
@ApiOperation(value = "角色列表不分页")
@PostMapping("/listNotPage")
public AjaxResult list()
@@ -77,7 +79,7 @@
List<SysRole> list = roleService.selectRoleList(new SysRole());
return AjaxResult.success(list);
}
-
+ @PreAuthorize("@ss.hasPermi('system:role:count')")
@ApiOperation(value = "角色数量统计")
@PostMapping("/roleCount")
public AjaxResult roleCount()
@@ -106,7 +108,7 @@
/**
* 根据角色编号获取详细信息
*/
- // @PreAuthorize("@ss.hasPermi('system:role:query')")
+ @PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/{roleId}")
public AjaxResult getInfo(@PathVariable Long roleId)
{
@@ -114,7 +116,7 @@
return AjaxResult.success(roleService.selectRoleById(roleId));
}
-
+// @PreAuthorize("@ss.hasPermi('system:role:detail')")
@ApiOperation("角色详情")
@GetMapping("/roleInfo")
public AjaxResult roleInfo(@RequestParam Long roleId)
@@ -150,7 +152,7 @@
/**
* 新增角色
*/
- // @PreAuthorize("@ss.hasPermi('system:role:add')")
+ @PreAuthorize("@ss.hasPermi('system:role:add')")
@ApiOperation(value = "新增角色")
@Log(title = "角色信息-新增角色", businessType = BusinessType.INSERT)
@PostMapping("/add")
@@ -168,7 +170,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