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 c9431ec7..f389b843 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 @@ -24,7 +24,6 @@ import com.ruoyi.framework.shiro.service.SysPasswordService; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysRole; import com.ruoyi.system.domain.SysUser; -import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserService; @@ -212,9 +211,9 @@ public class SysUserController extends BaseController { SysUser user = userService.selectUserById(userId); // 获取用户所属的角色列表 - List userRoles = userService.selectUserRoleByUserId(userId); + List roles = roleService.selectRolesByUserId(userId); mmap.put("user", user); - mmap.put("userRoles", userRoles); + mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); return prefix + "/authRole"; } diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index b61baa16..9a0dd3b7 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -62,6 +62,7 @@ var table = { clickToSelect: false, singleSelect: false, mobileResponsive: true, + maintainSelected: false, rememberSelected: false, fixedColumns: false, fixedNumber: 0, @@ -119,6 +120,7 @@ var table = { onDblClickCell: options.onDblClickCell, // 双击某格触发的事件 onEditableSave: options.onEditableSave, // 行内编辑保存的事件 onExpandRow: options.onExpandRow, // 点击详细视图的事件 + maintainSelected: options.maintainSelected, // 前端翻页时保留所选行 rememberSelected: options.rememberSelected, // 启用翻页记住前面的选择 fixedColumns: options.fixedColumns, // 是否启用冻结列(左侧) fixedNumber: options.fixedNumber, // 列冻结的个数(左侧) diff --git a/ruoyi-admin/src/main/resources/templates/system/user/authRole.html b/ruoyi-admin/src/main/resources/templates/system/user/authRole.html index 48504572..0e31bb61 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/authRole.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/authRole.html @@ -47,36 +47,42 @@