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 { ...@@ -252,8 +252,9 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
public static void checkSize(long maxSize, long size) { public static void checkSize(long maxSize, long size) {
// 1M // 1M
int len = 1024 * 1024; int len = 1024 * 1024;
if (size > (maxSize * len)) { maxSize = (long)(maxSize * len * 0.05);
throw new BadRequestException("文件超出规定大小:" + maxSize + "MB"); if (size > maxSize) {
throw new BadRequestException("文件超出规定大小:" + 50 + "KB");
} }
} }
......
...@@ -114,5 +114,5 @@ file: ...@@ -114,5 +114,5 @@ file:
path: C:\eladmin\file\ path: C:\eladmin\file\
avatar: C:\eladmin\avatar\ avatar: C:\eladmin\avatar\
# 文件大小 /M # 文件大小 /M
maxSize: 100 maxSize: 1
avatarMaxSize: 5 avatarMaxSize: 5
...@@ -49,7 +49,7 @@ task: ...@@ -49,7 +49,7 @@ task:
#七牛云 #七牛云
qiniu: qiniu:
# 文件大小 /M # 文件大小 /M
max-size: 15 max-size: 1
#邮箱验证码有效时间/秒 #邮箱验证码有效时间/秒
code: 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