比赛功能也太难写了

This commit is contained in:
masnn committed 2020-04-12 08:59:05 +08:00
1 parent f73859a42f
commit 32ad47e031
16 files changed
+195 -176

No files matched your search

+4 -7
View File
@@ -52,14 +52,11 @@ class ProblemRandomHandler extends ProblemHandler {
}
class ProblemDetailHandler extends ProblemHandler {
constructor(ctx) {
super(ctx);
this.uid = ctx.state.user._id;
this.pid = ctx.params.pid;
async _prepare({ pid }) {
this.response.template = 'problem_detail.html';
}
async _prepare() {
if (this.pid) this.pdoc = await problem.get(this);
this.uid = this.user._id;
this.pid = pid;
if (pid) this.pdoc = await problem.get(this);
if (this.pdoc.hidden && this.pdoc.owner != this.uid) this.checkPerm(PERM_VIEW_PROBLEM_HIDDEN);
if (this.pdoc) this.udoc = await user.getById(this.pdoc.owner);
this.response.body = {