Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pension
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
mengmeng
pension
Commits
a40cfc0e
Commit
a40cfc0e
authored
May 12, 2021
by
Shen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. admin模块添加静态资源访问,解决与swagger冲突问题
parent
2e8f45ff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
1 deletion
+12
-1
SwaggerConfig.java
...in/src/main/java/io/hmit/common/config/SwaggerConfig.java
+1
-0
ShiroConfig.java
...ain/java/io/hmit/modules/security/config/ShiroConfig.java
+1
-0
WebMvcConfig.java
...in/java/io/hmit/modules/security/config/WebMvcConfig.java
+8
-0
application.yml
hmit-admin/src/main/resources/application.yml
+1
-0
SwaggerConfig.java
hmit-api/src/main/java/io/hmit/config/SwaggerConfig.java
+1
-1
No files found.
hmit-admin/src/main/java/io/hmit/common/config/SwaggerConfig.java
View file @
a40cfc0e
...
@@ -33,6 +33,7 @@ public class SwaggerConfig {
...
@@ -33,6 +33,7 @@ public class SwaggerConfig {
@Bean
@Bean
public
Docket
createRestApi
()
{
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
host
(
"byyl.zjhmit.com"
)
.
apiInfo
(
apiInfo
())
.
apiInfo
(
apiInfo
())
.
select
()
.
select
()
//加了ApiOperation注解的类,生成接口文档
//加了ApiOperation注解的类,生成接口文档
...
...
hmit-admin/src/main/java/io/hmit/modules/security/config/ShiroConfig.java
View file @
a40cfc0e
...
@@ -57,6 +57,7 @@ public class ShiroConfig {
...
@@ -57,6 +57,7 @@ public class ShiroConfig {
shiroFilter
.
setFilters
(
filters
);
shiroFilter
.
setFilters
(
filters
);
Map
<
String
,
String
>
filterMap
=
new
LinkedHashMap
<>();
Map
<
String
,
String
>
filterMap
=
new
LinkedHashMap
<>();
filterMap
.
put
(
"/static/**"
,
"anon"
);
filterMap
.
put
(
"/webjars/**"
,
"anon"
);
filterMap
.
put
(
"/webjars/**"
,
"anon"
);
filterMap
.
put
(
"/druid/**"
,
"anon"
);
filterMap
.
put
(
"/druid/**"
,
"anon"
);
filterMap
.
put
(
"/login"
,
"anon"
);
filterMap
.
put
(
"/login"
,
"anon"
);
...
...
hmit-admin/src/main/java/io/hmit/modules/security/config/WebMvcConfig.java
View file @
a40cfc0e
...
@@ -14,6 +14,7 @@ import org.springframework.http.converter.StringHttpMessageConverter;
...
@@ -14,6 +14,7 @@ import org.springframework.http.converter.StringHttpMessageConverter;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter
;
import
org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -23,6 +24,13 @@ import java.util.TimeZone;
...
@@ -23,6 +24,13 @@ import java.util.TimeZone;
@Configuration
@Configuration
public
class
WebMvcConfig
implements
WebMvcConfigurer
{
public
class
WebMvcConfig
implements
WebMvcConfigurer
{
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
registry
.
addResourceHandler
(
"/swagger2/**"
).
addResourceLocations
(
"classpath:/swagger2/"
);
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"file:/home/websoft/java_jar/pension_service/myfile/"
);
// registry.addResourceHandler("/static/**").addResourceLocations("file:D:/upload/pension/");
}
@Override
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
...
...
hmit-admin/src/main/resources/application.yml
View file @
a40cfc0e
...
@@ -72,5 +72,6 @@ mybatis-plus:
...
@@ -72,5 +72,6 @@ mybatis-plus:
call-setters-on-nulls
:
true
call-setters-on-nulls
:
true
jdbc-type-for-null
:
'
null'
jdbc-type-for-null
:
'
null'
QR
:
QR
:
# download-path: D:/upload/pension/
# download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/pension_service/myfile/
# download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/pension_service/myfile/
download-path
:
/home/websoft/java_jar/pension_service/myfile/
download-path
:
/home/websoft/java_jar/pension_service/myfile/
hmit-api/src/main/java/io/hmit/config/SwaggerConfig.java
View file @
a40cfc0e
...
@@ -27,7 +27,7 @@ public class SwaggerConfig {
...
@@ -27,7 +27,7 @@ public class SwaggerConfig {
@Bean
@Bean
public
Docket
createRestApi
()
{
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
host
(
"byyl.zjhmit.com"
)
//
.host("byyl.zjhmit.com")
.
apiInfo
(
apiInfo
())
.
apiInfo
(
apiInfo
())
.
select
()
.
select
()
//加了ApiOperation注解的类,才生成接口文档
//加了ApiOperation注解的类,才生成接口文档
...
...
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