mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
比赛功能也太难写了
This commit is contained in:
1 parent
f73859a42f
commit
32ad47e031
16 files changed
+195
-176
No files matched your search
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user