diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java index 283be66..1d16ec5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java @@ -86,7 +86,6 @@ public class UserExamController extends BaseController { @ResponseBody public TableDataInfo myGrades(UserExamReqDTO reqDTO) { startPage(); - reqDTO.setUserId(getUserId()); List list = userExamManager.selectExamList(reqDTO); return getDataTable(list); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java index 6cf1250..1322af5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java @@ -1,6 +1,8 @@ package com.ruoyi.web.controller.manager; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.system.domain.check.TdCheckReport; import com.ruoyi.system.domain.exam.ExamManagerDTO; import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; @@ -19,6 +21,8 @@ import java.util.Date; import java.util.List; import java.util.Objects; +import static com.ruoyi.common.utils.ShiroUtils.getUserId; + /** * packageName com.ruoyi.web.controller.manager * @@ -49,6 +53,9 @@ public class UserExamManager { * @return java.util.List */ public List selectExamList(UserExamReqDTO reqDTO) { + if (!SysUser.isAdmin(ShiroUtils.getUserId())){ + reqDTO.setUserId(getUserId()); + } return elUserExamService.selectExamList(reqDTO); }