mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 01:38:19 +08:00
core: 支持在题目中通过 file://name 索引至附加文件
This commit is contained in:
1 parent
99efc98d2d
commit
252a251ce4
7 files changed
+14
-34
No files matched your search
@@ -190,7 +190,13 @@ export class ProblemDetailHandler extends ProblemHandler {
|
||||
};
|
||||
}
|
||||
|
||||
async get(...args: any[]) { } // eslint-disable-line
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async get(..._args: any[]) {
|
||||
// Navigate to current additional file download
|
||||
// e.g.  will navigate to 
|
||||
this.response.body.pdoc.content = this.response.body.pdoc.content
|
||||
.replace(/\(file:\/\//g, `(./${this.pdoc.docId}/file/`);
|
||||
}
|
||||
|
||||
@param('pid', Types.UnsignedInt)
|
||||
async postRejudge(domainId: string, pid: number) {
|
||||
@@ -207,7 +213,7 @@ export class ProblemDetailHandler extends ProblemHandler {
|
||||
export class ProblemExportHandler extends ProblemDetailHandler {
|
||||
async get() {
|
||||
const hasPerm = (this.user._id === this.pdoc.owner && this.user.hasPerm(PERM.PERM_READ_PROBLEM_DATA_SELF))
|
||||
|| this.user.hasPerm(PERM.PERM_READ_PROBLEM_DATA_SELF);
|
||||
|| this.user.hasPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||
const pdoc = pick(this.pdoc, ['pid', 'acMsg', 'content', 'config', 'title', 'html', 'tag', 'category']);
|
||||
const zip = new AdmZip();
|
||||
if (hasPerm) {
|
||||
|
||||
Reference in new issue
Block a user