From 9abc6588d464269024d3e680b98cfd71e2acc84e Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: Wed, 29 Apr 2026 13:14:15 +0800
Subject: [PATCH] 新增修改部分限制

---
 multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysRoleServiceImpl.java |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysRoleServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysRoleServiceImpl.java
index ac4ca56..5eed558 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysRoleServiceImpl.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysRoleServiceImpl.java
@@ -2,11 +2,9 @@
 
 
 import cn.hutool.core.util.ObjectUtil;
-import com.gkhy.exam.common.annotation.DataScope;
 import com.gkhy.exam.common.api.CommonPage;
 import com.gkhy.exam.common.constant.UserConstant;
 import com.gkhy.exam.common.domain.entity.SysRole;
-import com.gkhy.exam.common.domain.entity.SysUser;
 import com.gkhy.exam.common.exception.ApiException;
 import com.gkhy.exam.common.utils.PageUtils;
 import com.gkhy.exam.common.utils.SecurityUtils;
@@ -17,7 +15,6 @@
 import com.gkhy.exam.system.mapper.SysRoleMenuMapper;
 import com.gkhy.exam.system.mapper.SysUserRoleMapper;
 import com.gkhy.exam.system.service.ISysRoleService;
-import com.google.protobuf.ServiceException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -197,13 +194,13 @@
     @Override
     public void checkRoleDataScope(Long... roleIds)
     {
-        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()))
+        if (!SecurityUtils.adminUser())
         {
             for (Long roleId : roleIds)
             {
                 SysRole role = new SysRole();
                 role.setRoleId(roleId);
-                List<SysRole> roles = (List<SysRole>) SpringUtils.getAopProxy(this).selectRoleList(role);
+                List<SysRole> roles = (List<SysRole>) SpringUtils.getAopProxy(this).selectRoleList(role).getList();
                 if (ObjectUtil.isEmpty(roles))
                 {
                     throw new ApiException("没有权限访问角色数据!");

--
Gitblit v1.9.2