演示环境文件大小限制

pull/789/head
Zheng Jie 2022-05-25 11:24:00 +08:00
parent 02bd5ce7d1
commit 71279e3a40
3 changed files with 5 additions and 4 deletions

View File

@ -252,8 +252,9 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
public static void checkSize(long maxSize, long size) {
// 1M
int len = 1024 * 1024;
if (size > (maxSize * len)) {
throw new BadRequestException("文件超出规定大小:" + maxSize + "MB");
maxSize = (long)(maxSize * len * 0.05);
if (size > maxSize) {
throw new BadRequestException("文件超出规定大小:" + 50 + "KB");
}
}

View File

@ -114,5 +114,5 @@ file:
path: C:\eladmin\file\
avatar: C:\eladmin\avatar\
# 文件大小 /M
maxSize: 100
maxSize: 1
avatarMaxSize: 5

View File

@ -49,7 +49,7 @@ task:
#七牛云
qiniu:
# 文件大小 /M
max-size: 15
max-size: 1
#邮箱验证码有效时间/秒
code: