Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
ee16e808
Commit
ee16e808
authored
Apr 08, 2021
by
wujj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源访问问题
parent
f5f9d29b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
WebConfig.java
src/main/java/net/mingsoft/config/WebConfig.java
+1
-1
application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/net/mingsoft/config/WebConfig.java
View file @
ee16e808
...
@@ -94,7 +94,7 @@ public class WebConfig implements WebMvcConfigurer {
...
@@ -94,7 +94,7 @@ public class WebConfig implements WebMvcConfigurer {
registry
.
addResourceHandler
(
uploadMapping
).
addResourceLocations
(
File
.
separator
+
uploadFloderPath
+
File
.
separator
,
"file:"
+
uploadFloderPath
+
File
.
separator
,
"classpath:/template/"
);
registry
.
addResourceHandler
(
uploadMapping
).
addResourceLocations
(
File
.
separator
+
uploadFloderPath
+
File
.
separator
,
"file:"
+
uploadFloderPath
+
File
.
separator
,
"classpath:/template/"
);
registry
.
addResourceHandler
(
"/template/**"
).
addResourceLocations
(
File
.
separator
+
template
+
File
.
separator
,
"file:"
+
template
+
File
.
separator
,
"classpath:/html/"
);
registry
.
addResourceHandler
(
"/template/**"
).
addResourceLocations
(
File
.
separator
+
template
+
File
.
separator
,
"file:"
+
template
+
File
.
separator
,
"classpath:/html/"
);
//注意这里的htmlDir资源不能使用File.separator替代"/",会导致Windows一键版访问失效
//注意这里的htmlDir资源不能使用File.separator替代"/",会导致Windows一键版访问失效
registry
.
addResourceHandler
(
htmlDir
.
concat
(
"/**"
)).
addResourceLocations
(
htmlDir
.
concat
(
"/"
),
"file:"
.
concat
(
htmlDir
).
concat
(
"/"
));
registry
.
addResourceHandler
(
"/"
.
concat
(
htmlDir
).
concat
(
"/**"
)).
addResourceLocations
(
"/"
.
concat
(
htmlDir
)
.
concat
(
"/"
),
"file:"
.
concat
(
htmlDir
).
concat
(
"/"
));
//三种映射方式 webapp下、当前目录下、jar内
//三种映射方式 webapp下、当前目录下、jar内
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"/app/"
,
"file:app/"
,
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"/app/"
,
"file:app/"
,
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"/static/"
,
"file:static/"
,
"classpath:/static/"
,
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"/static/"
,
"file:static/"
,
"classpath:/static/"
,
"classpath:/META-INF/resources/"
);
...
...
src/main/resources/application.yml
View file @
ee16e808
...
@@ -13,7 +13,7 @@ logging:
...
@@ -13,7 +13,7 @@ logging:
path
:
log
#会在项目的根目录下生成log目录,里面会生成对应的日期目录,日期目录下面生成日志压缩包备份文件,默认按每10M分割一个日志文件,例如:log/2020-01/app-2020-01-03-18.1.log.gz(表示2020年1月3号下午六点的第一个备份),也可以根据实际情况写绝对路径,例如:d:/log
path
:
log
#会在项目的根目录下生成log目录,里面会生成对应的日期目录,日期目录下面生成日志压缩包备份文件,默认按每10M分割一个日志文件,例如:log/2020-01/app-2020-01-03-18.1.log.gz(表示2020年1月3号下午六点的第一个备份),也可以根据实际情况写绝对路径,例如:d:/log
ms
:
ms
:
diy
:
diy
:
html-dir
:
/
html
html-dir
:
html
# scheme: https #解决使用代理服务器代理应用时标签解析域名依旧为http的问题
# scheme: https #解决使用代理服务器代理应用时标签解析域名依旧为http的问题
swagger
:
swagger
:
enable
:
false
#启用swagger文档,生产的时候务必关掉 访问地址:http://ip|域名/项目发布名/swagger-ui.html
enable
:
false
#启用swagger文档,生产的时候务必关掉 访问地址:http://ip|域名/项目发布名/swagger-ui.html
...
...
Write
Preview
Markdown
is supported
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