mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: 优化比赛模块鉴权(比赛结束时可自由查看题目)
This commit is contained in:
1 parent
99e0d2fb14
commit
c1da60a37e
4 files changed
+5
-4
No files matched your search
@@ -241,7 +241,7 @@ class ContestProblemHandler extends ContestHandler {
|
||||
]);
|
||||
this.attended = this.tsdoc && this.tsdoc.attend === 1;
|
||||
this.response.template = 'problem_detail.html';
|
||||
if (contest.isDone(this.tdoc)) {
|
||||
if (!contest.isDone(this.tdoc)) {
|
||||
if (!this.attended) throw new ContestNotAttendedError(this.tdoc.docId);
|
||||
if (contest.isNotStarted(this.tdoc)) throw new ContestNotLiveError(this.tdoc.docId);
|
||||
}
|
||||
@@ -272,6 +272,7 @@ class ContestProblemSubmitHandler extends ContestProblemHandler {
|
||||
@param('tid', Types.ObjectID)
|
||||
@param('pid', Types.UnsignedInt)
|
||||
async prepare(domainId: string, tid: ObjectID, pid: number) {
|
||||
if (contest.isOngoing(this.tdoc)) throw new ContestNotLiveError(this.tdoc.docId);
|
||||
let rdocs = [];
|
||||
if (this.canShowRecord(this.tdoc)) {
|
||||
rdocs = await record.getUserInProblemMulti(
|
||||
|
||||
Reference in new issue
Block a user