错误修复

This commit is contained in:
masnn committed 2020-05-29 20:00:40 +08:00
1 parent fff2172c38
commit 257d9814a9
15 files changed
+57 -63

No files matched your search

+3 -3
View File
@@ -43,8 +43,8 @@ class ContestListHandler extends ContestHandler {
}
class ContestDetailHandler extends ContestHandler {
async _prepare({ tid }) {
this.tdoc = await contest.get(tid);
async _prepare({ domainId, tid }) {
this.tdoc = await contest.get(domainId, tid);
}
async get({ domainId, page = 1 }) {
@@ -66,7 +66,7 @@ class ContestDetailHandler extends ContestHandler {
for (const i in psdict) rdict[psdict[i].rid] = { _id: psdict[i].rid };
}
} else attended = false;
const udict = await user.getList([this.tdoc.owner]);
const udict = await user.getList(domainId, [this.tdoc.owner]);
const path = [
['Hydro', '/'],
['contest_main', '/c'],
+1 -1
View File
@@ -19,7 +19,7 @@ async function _postJudge(rdoc) {
contest.updateStatus(rdoc.domainId, rdoc.tid, rdoc.uid, rdoc._id, rdoc.pid, accept, rdoc.score),
);
}
if (await problem.updateStatus(rdoc.rdoc.pid, rdoc.uid, rdoc._id, rdoc.status)) {
if (await problem.updateStatus(rdoc.pid, rdoc.uid, rdoc._id, rdoc.status)) {
if (accept && !rdoc.rejudged) {
tasks.push(
problem.inc(rdoc.domainId, rdoc.pid, 'nAccept', 1),
+2 -2
View File
@@ -73,7 +73,7 @@ class RecordConnectionHandler extends ConnectionHandler {
async message(msg) {
for (const rid of msg.rids) {
const rdoc = await record.get(rid); // eslint-disable-line no-await-in-loop
const rdoc = await record.get(this.domainId, rid); // eslint-disable-line no-await-in-loop
await this.onRecordChange({ value: rdoc }); // eslint-disable-line no-await-in-loop
}
}
@@ -88,7 +88,7 @@ class RecordConnectionHandler extends ConnectionHandler {
// eslint-disable-next-line prefer-const
let [udoc, pdoc] = await Promise.all([
user.getById(this.domainId, rdoc.uid),
problem.getById(this.domainId, rdoc.pid),
problem.get(this.domainId, rdoc.pid),
]);
if (pdoc.hidden && !this.user.hasPerm(PERM_VIEW_PROBLEM_HIDDEN)) pdoc = null;
this.send({ html: await this.renderHTML('record_main_tr.html', { rdoc, udoc, pdoc }) });