禁用比赛看到除自己的提交外其它提交的时间、空间、长度
This commit is contained in:
parent
2c99dd72ea
commit
6c4ffdfad4
|
@ -414,10 +414,22 @@ public class ContestController {
|
|||
IPage<JudgeVo> commonJudgeList = judgeService.getContestJudgeList(limit, currentPage, displayId, searchCid,
|
||||
searchStatus, searchUsername, uid, beforeContestSubmit, rule, contest.getStartTime(), sealRankTime, userRolesVo.getUid());
|
||||
|
||||
|
||||
if (commonJudgeList.getTotal() == 0) { // 未查询到一条数据
|
||||
return CommonResult.successResponse(null, "暂无数据");
|
||||
} else {
|
||||
|
||||
// 比赛还是进行阶段,同时不是超级管理员与比赛管理员,需要将除自己之外的提交的时间、空间、长度隐藏
|
||||
if (contest.getStatus().intValue() == Constants.Contest.STATUS_RUNNING.getCode()
|
||||
&& !isRoot && !userRolesVo.getUid().equals(contest.getUid())) {
|
||||
commonJudgeList.getRecords().forEach(judgeVo -> {
|
||||
if (!judgeVo.getUid().equals(userRolesVo.getUid())) {
|
||||
judgeVo.setTime(null);
|
||||
judgeVo.setMemory(null);
|
||||
judgeVo.setLength(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return CommonResult.successResponse(commonJudgeList, "获取成功");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -348,9 +348,15 @@ public class JudgeController {
|
|||
result.put("submission", new Judge().setStatus(Constants.Judge.STATUS_SUBMITTED_UNKNOWN_RESULT.getStatus()));
|
||||
return CommonResult.successResponse(result, "获取提交数据成功!");
|
||||
}
|
||||
// 不是本人的话不能查看代码
|
||||
if(!userRolesVo.getUid().equals(judge.getUid())) {
|
||||
// 不是本人的话不能查看代码、时间,空间,长度
|
||||
if (!userRolesVo.getUid().equals(judge.getUid())) {
|
||||
judge.setCode(null);
|
||||
// 如果还在比赛时间,不是本人不能查看时间,空间,长度
|
||||
if (contest.getStatus().intValue() == Constants.Contest.STATUS_RUNNING.getCode()) {
|
||||
judge.setTime(null);
|
||||
judge.setMemory(null);
|
||||
judge.setLength(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -457,6 +463,7 @@ public class JudgeController {
|
|||
IPage<JudgeVo> commonJudgeList = judgeService.getCommonJudgeList(limit, currentPage, searchPid,
|
||||
searchStatus, searchUsername, uid);
|
||||
|
||||
|
||||
if (commonJudgeList.getTotal() == 0) { // 未查询到一条数据
|
||||
return CommonResult.successResponse(null, "暂无数据");
|
||||
} else {
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
</vxe-table-column>
|
||||
<vxe-table-column field="time" :title="$t('m.Time')" min-width="96">
|
||||
<template v-slot="{ row }">
|
||||
<span>{{ submissionTimeFormat(row.time) }}</span>
|
||||
<span v-if="!contestID">{{ submissionTimeFormat(row.time) }}</span>
|
||||
</template>
|
||||
</vxe-table-column>
|
||||
<vxe-table-column
|
||||
|
|
Loading…
Reference in New Issue