core: 修复错误

* 无法下载测试数据的问题
* 无法导出作业成绩单的问题
* cli 模式无法载入的问题
* syzoj 导入跳转错误的问题
This commit is contained in:
undefined committed 2021-01-25 22:23:06 +08:00
1 parent 66639b14de
commit f0b9bee937
8 files changed
+19 -26

No files matched your search

+1 -1
View File
@@ -370,7 +370,7 @@ class HomeworkScoreboardDownloadHandler extends HomeworkHandler {
html: (rows) => this.renderHTML('contest_scoreboard_download_html.html', { rows }),
};
if (!getContent[ext]) throw new ValidationError('ext');
const [, rows] = await this.getScoreboard(domainId, tid, true, document.TYPE_CONTEST);
const [, rows] = await this.getScoreboard(domainId, tid, true, document.TYPE_HOMEWORK);
this.binary(await getContent[ext](rows), `${this.tdoc.title}.${ext}`);
}
}
+4 -4
View File
@@ -247,12 +247,12 @@ class ProblemImportSYZOJHandler extends Handler {
domainId, targetPid, hidden,
protocol, host, pid, false,
);
this.response.body = { pid: pid || docId };
this.response.redirect = this.url('problem_settings', { pid: pid || docId });
this.response.body = { pid: targetPid || docId };
this.response.redirect = this.url('problem_settings', { pid: targetPid || docId });
} else {
const docId = await this.v2(domainId, targetPid, hidden, url);
this.response.body = { pid: pid || docId };
this.response.redirect = this.url('problem_settings', { pid: pid || docId });
this.response.body = { pid: targetPid || docId };
this.response.redirect = this.url('problem_settings', { pid: targetPid || docId });
}
}
}