public async Task <dynamic> OnGetStuExamAsync(int examID, string stuID, string token) { try { var t = await tokenService.GetTokenAsync(token); if (t == null) { throw new Exception("请先登录"); } if (t.Role != UserRole.Admin) { var courseRole = await examService.GetExamRoleAsync(examID, t.UserID); if (courseRole == UserRole.Student) { throw new Exception("权限不足"); } } var stuExam = await examService.GetStuExamDetialTAsync(stuID, examID); return(new { Res = true, StuExam = stuExam }); } catch (Exception e) { return(new { Res = false, Error = e.Message }); } }