core: 添加handler/create和handler/init事件

This commit is contained in:
undefined committed 2021-03-27 14:18:23 +08:00
1 parent f7478ab346
commit 3040f17702
5 files changed
+14 -2

No files matched your search

+1 -1
View File
@@ -379,7 +379,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
async postUploadFile(domainId: string, filename: string, type = 'testdata') {
if (!this.request.files.file) throw new ValidationError('file');
if (this.pdoc.owner !== this.user._id) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
if (filename === 'testdata.zip') {
if (filename.endsWith('.zip')) {
const zip = new AdmZip(this.request.files.file.path);
const entries = zip.getEntries();
for (const entry of entries) {