Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
71279e3a
Commit
71279e3a
authored
May 25, 2022
by
Zheng Jie
Browse files
演示环境文件大小限制
parent
02bd5ce7
Changes
3
Hide whitespace changes
Inline
Side-by-side
eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
View file @
71279e3a
...
...
@@ -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"
);
}
}
...
...
eladmin-system/src/main/resources/config/application-dev.yml
View file @
71279e3a
...
...
@@ -114,5 +114,5 @@ file:
path
:
C:\eladmin\file\
avatar
:
C:\eladmin\avatar\
# 文件大小 /M
maxSize
:
1
00
maxSize
:
1
avatarMaxSize
:
5
eladmin-system/src/main/resources/config/application.yml
View file @
71279e3a
...
...
@@ -49,7 +49,7 @@ task:
#七牛云
qiniu
:
# 文件大小 /M
max-size
:
1
5
max-size
:
1
#邮箱验证码有效时间/秒
code
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment