mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: api: problem.manage.edit & problem.manage.delete
This commit is contained in:
1 parent
a75804362d
commit
5d9310fb78
7 files changed
+62
-15
No files matched your search
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable camelcase */
|
||||
import { statSync } from 'fs';
|
||||
import { pick } from 'lodash';
|
||||
import { lookup } from 'mime-types';
|
||||
import {
|
||||
@@ -47,7 +48,8 @@ export class FilesHandler extends Handler {
|
||||
throw new ForbiddenError('File limit exceeded.');
|
||||
}
|
||||
if (!this.request.files.file) throw new ValidationError('file');
|
||||
const size = Math.sum((this.user._files || []).map((i) => i.size));
|
||||
const f = statSync(this.request.files.file.path);
|
||||
const size = Math.sum((this.user._files || []).map((i) => i.size)) + f.size;
|
||||
if (size >= system.get('limit.user_files_size')) {
|
||||
throw new ForbiddenError('File size limit exceeded.');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user