Commit 71279e3a authored by Zheng Jie's avatar Zheng Jie
Browse files

演示环境文件大小限制

parent 02bd5ce7
......@@ -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");
}
}
......
......@@ -114,5 +114,5 @@ file:
path: C:\eladmin\file\
avatar: C:\eladmin\avatar\
# 文件大小 /M
maxSize: 100
maxSize: 1
avatarMaxSize: 5
......@@ -49,7 +49,7 @@ task:
#七牛云
qiniu:
# 文件大小 /M
max-size: 15
max-size: 1
#邮箱验证码有效时间/秒
code:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment