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
7bf78d32
"eladmin-tools/git@ustchcs.com:gujinli1118/eladmin.git" did not exist on "7c35a79c955b66ad92e89c9b8944e14d2d84580a"
Commit
7bf78d32
authored
Mar 18, 2022
by
Zheng Jie
Browse files
限制文件上传大小
parent
4eeabb84
Changes
2
Hide whitespace changes
Inline
Side-by-side
eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
View file @
7bf78d32
...
@@ -253,7 +253,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
...
@@ -253,7 +253,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
// 1M
// 1M
int
len
=
1024
*
1024
;
int
len
=
1024
*
1024
;
if
(
size
>
(
maxSize
*
len
))
{
if
(
size
>
(
maxSize
*
len
))
{
throw
new
BadRequestException
(
"文件超出规定大小"
);
throw
new
BadRequestException
(
"文件超出规定大小
:"
+
maxSize
+
"M
"
);
}
}
}
}
...
...
eladmin-system/src/main/resources/config/application-prod.yml
View file @
7bf78d32
...
@@ -122,5 +122,5 @@ file:
...
@@ -122,5 +122,5 @@ file:
path
:
C:\eladmin\file\
path
:
C:\eladmin\file\
avatar
:
C:\eladmin\avatar\
avatar
:
C:\eladmin\avatar\
# 文件大小 /M
# 文件大小 /M
maxSize
:
1
00
maxSize
:
1
avatarMaxSize
:
5
avatarMaxSize
:
5
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