mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: auto-manage daily task
This commit is contained in:
1 parent
c7c70a6abb
commit
bf88b828ec
4 files changed
+33
-34
No files matched your search
@@ -310,17 +310,13 @@ export class ContestProblemHandler extends Handler {
|
||||
}
|
||||
|
||||
export class ContestProblemFileDownloadHandler extends ContestProblemHandler {
|
||||
@query('type', Types.Range(['additional_file', 'testdata']), true)
|
||||
@param('filename', Types.Name)
|
||||
@param('noDisposition', Types.Boolean)
|
||||
async get(domainId: string, type = 'additional_file', filename: string, noDisposition = false) {
|
||||
if (type === 'testdata' && !this.user.own(this.pdoc)) {
|
||||
if (!this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)) this.checkPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||
}
|
||||
async get(domainId: string, filename: string, noDisposition = false) {
|
||||
// @ts-ignore
|
||||
if (typeof this.pdoc.docId === 'string') this.pdoc.docId = this.pdoc.docId.split(':')[1];
|
||||
this.response.redirect = await storage.signDownloadLink(
|
||||
`problem/${this.pdoc.domainId}/${this.pdoc.docId}/${type}/${filename}`,
|
||||
`problem/${this.pdoc.domainId}/${this.pdoc.docId}/additional_file/${filename}`,
|
||||
noDisposition ? undefined : filename, false, 'user',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user