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
474e5688
Commit
474e5688
authored
Nov 04, 2019
by
dqjdda
Browse files
Merge branch 'master' of github.com:elunez/eladmin
parents
ef03d1c8
9882cb97
Changes
2
Hide whitespace changes
Inline
Side-by-side
eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
View file @
474e5688
...
...
@@ -140,7 +140,8 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
try
{
String
fileName
=
name
+
nowStr
+
"."
+
suffix
;
String
path
=
filePath
+
fileName
;
File
dest
=
new
File
(
path
);
// getCanonicalFile 可解析正确各种路径
File
dest
=
new
File
(
path
).
getCanonicalFile
();
// 检测是否存在目录
if
(!
dest
.
getParentFile
().
exists
())
{
dest
.
getParentFile
().
mkdirs
();
...
...
eladmin-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java
View file @
474e5688
...
...
@@ -35,8 +35,8 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
String
avatarUtl
=
"file:"
+
avatar
.
replace
(
"\\"
,
"/"
);
String
pathUtl
=
"file:"
+
path
.
replace
(
"\\"
,
"/"
);
String
avatarUtl
=
Paths
.
get
(
avatar
).
normalize
().
toUri
().
toASCIIString
(
);
String
pathUtl
=
Paths
.
get
(
path
).
normalize
().
toUri
().
toASCIIString
(
);
registry
.
addResourceHandler
(
"/avatar/**"
).
addResourceLocations
(
avatarUtl
).
setCachePeriod
(
0
);
registry
.
addResourceHandler
(
"/file/**"
).
addResourceLocations
(
pathUtl
).
setCachePeriod
(
0
);
registry
.
addResourceHandler
(
"/**"
).
addResourceLocations
(
"classpath:/META-INF/resources/"
).
setCachePeriod
(
0
);
...
...
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