暴漏server对象

This commit is contained in:
undefined committed 2020-08-01 14:43:35 +08:00
1 parent 0194ab4eb0
commit e66d5a0221
7 files changed
+18 -9

No files matched your search

+1 -1
View File
@@ -61,7 +61,7 @@ class DiscussionHandler extends Handler {
// TODO(twd2): do more visibility check eg. contest
// TODO(twd2): exclude problem/contest discussions?
// TODO(iceboy): continuation based pagination.
if (ObjectID.isValid(name)) name = new ObjectID(name);
if (ObjectID.isValid(name.toString())) name = new ObjectID(name);
this.vnode = await discussion.getVnode(domainId, typeMapper[type], name, this);
if (this.ddoc) {
this.ddoc.parentType = this.ddoc.parentType || this.vnode.type;
+4 -2
View File
@@ -351,6 +351,9 @@ class ProblemSettingsHandler extends ProblemManageHandler {
[this.pdoc.title, 'problem_detail', { pid }, true],
['problem_settings', null],
];
if (this.response.body.config) {
this.response.body.config = yaml.safeDump(this.response.body.config);
}
}
@param('pid', Types.String, null, parsePid)
@@ -386,7 +389,6 @@ class ProblemEditHandler extends ProblemManageHandler {
[this.pdoc.title, 'problem_detail', { pid }, true],
['problem_edit', null],
];
this.response.body.page_name = 'problem_edit';
}
@param('title', Types.String, isTitle)
@@ -395,7 +397,7 @@ class ProblemEditHandler extends ProblemManageHandler {
const pid = checkPid(this.request.body.pid);
const pdoc = await problem.get(domainId, this.request.params.pid);
await problem.edit(domainId, pdoc.docId, { title, content, pid });
this.response.redirect = this.url('problem_detail', this.request.params.pid);
this.response.redirect = this.url('problem_detail', { pid: this.request.params.pid });
}
}
+1 -1
View File
@@ -124,7 +124,7 @@ class RecordMainConnectionHandler extends RecordConnectionHandler {
this.domainId, { _id: { $in: rids } },
).toArray();
for (const rdoc of rdocs) {
this.onRecordChange({ value: rdoc });
this.onRecordChange({ value: { rdoc } });
}
}
}