From 10aaa035f5be0312304d20f022bdb714a8f4900a Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 11 十二月 2024 22:16:23 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java | 56 +++++++++++++++++++++++++++-----------------------------
1 files changed, 27 insertions(+), 29 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 49907eb..f9b3d69 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
@@ -2,14 +2,13 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.core.domain.entity.SysUserRole;
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.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -27,14 +26,13 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.framework.web.service.TokenService;
-import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
* 瑙掕壊淇℃伅
- *
+ *
* @author ruoyi
*/
@RestController
@@ -56,7 +54,7 @@
@Autowired
private ISysDeptService deptService;
- @PreAuthorize("@ss.hasPermi('system:role:list')")
+ //@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/list")
public TableDataInfo list(SysRole role)
{
@@ -66,7 +64,7 @@
}
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.EXPORT)
- @PreAuthorize("@ss.hasPermi('system:role:export')")
+ //@PreAuthorize("@ss.hasPermi('system:role:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysRole role)
{
@@ -78,7 +76,7 @@
/**
* 鏍规嵁瑙掕壊缂栧彿鑾峰彇璇︾粏淇℃伅
*/
- @PreAuthorize("@ss.hasPermi('system:role:query')")
+ //@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/{roleId}")
public AjaxResult getInfo(@PathVariable Long roleId)
{
@@ -89,9 +87,9 @@
/**
* 鏂板瑙掕壊
*/
- @PreAuthorize("@ss.hasPermi('system:role:add')")
+ //@PreAuthorize("@ss.hasPermi('system:role:add')")
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.INSERT)
- @PostMapping
+ @PostMapping("/add")
public AjaxResult add(@Validated @RequestBody SysRole role)
{
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
@@ -110,9 +108,9 @@
/**
* 淇敼淇濆瓨瑙掕壊
*/
- @PreAuthorize("@ss.hasPermi('system:role:edit')")
+ //@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE)
- @PutMapping
+ @PostMapping("/edit")
public AjaxResult edit(@Validated @RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
@@ -126,7 +124,7 @@
return error("淇敼瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹叉潈闄愬凡瀛樺湪");
}
role.setUpdateBy(getUsername());
-
+
if (roleService.updateRole(role) > 0)
{
// 鏇存柊缂撳瓨鐢ㄦ埛鏉冮檺
@@ -145,9 +143,9 @@
/**
* 淇敼淇濆瓨鏁版嵁鏉冮檺
*/
- @PreAuthorize("@ss.hasPermi('system:role:edit')")
+ //@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE)
- @PutMapping("/dataScope")
+ @PostMapping("/dataScope")
public AjaxResult dataScope(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
@@ -158,9 +156,9 @@
/**
* 鐘舵�佷慨鏀�
*/
- @PreAuthorize("@ss.hasPermi('system:role:edit')")
+ //@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE)
- @PutMapping("/changeStatus")
+ @PostMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
@@ -172,9 +170,9 @@
/**
* 鍒犻櫎瑙掕壊
*/
- @PreAuthorize("@ss.hasPermi('system:role:remove')")
+ //@PreAuthorize("@ss.hasPermi('system:role:remove')")
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.DELETE)
- @DeleteMapping("/{roleIds}")
+ @GetMapping("/remove/{roleIds}")
public AjaxResult remove(@PathVariable Long[] roleIds)
{
return toAjax(roleService.deleteRoleByIds(roleIds));
@@ -183,7 +181,7 @@
/**
* 鑾峰彇瑙掕壊閫夋嫨妗嗗垪琛�
*/
- @PreAuthorize("@ss.hasPermi('system:role:query')")
+ //@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
@@ -193,7 +191,7 @@
/**
* 鏌ヨ宸插垎閰嶇敤鎴疯鑹插垪琛�
*/
- @PreAuthorize("@ss.hasPermi('system:role:list')")
+ //@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/allocatedList")
public TableDataInfo allocatedList(SysUser user)
{
@@ -205,7 +203,7 @@
/**
* 鏌ヨ鏈垎閰嶇敤鎴疯鑹插垪琛�
*/
- @PreAuthorize("@ss.hasPermi('system:role:list')")
+ //@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/unallocatedList")
public TableDataInfo unallocatedList(SysUser user)
{
@@ -217,9 +215,9 @@
/**
* 鍙栨秷鎺堟潈鐢ㄦ埛
*/
- @PreAuthorize("@ss.hasPermi('system:role:edit')")
+ //@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT)
- @PutMapping("/authUser/cancel")
+ @PostMapping("/authUser/cancel")
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
{
return toAjax(roleService.deleteAuthUser(userRole));
@@ -228,9 +226,9 @@
/**
* 鎵归噺鍙栨秷鎺堟潈鐢ㄦ埛
*/
- @PreAuthorize("@ss.hasPermi('system:role:edit')")
+ //@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT)
- @PutMapping("/authUser/cancelAll")
+ @PostMapping("/authUser/cancelAll")
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
{
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
@@ -239,9 +237,9 @@
/**
* 鎵归噺閫夋嫨鐢ㄦ埛鎺堟潈
*/
- @PreAuthorize("@ss.hasPermi('system:role:edit')")
+ //@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT)
- @PutMapping("/authUser/selectAll")
+ @PostMapping("/authUser/selectAll")
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
{
roleService.checkRoleDataScope(roleId);
@@ -251,7 +249,7 @@
/**
* 鑾峰彇瀵瑰簲瑙掕壊閮ㄩ棬鏍戝垪琛�
*/
- @PreAuthorize("@ss.hasPermi('system:role:query')")
+ //@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/deptTree/{roleId}")
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
{
--
Gitblit v1.9.3