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
RuoYi Vue
Commits
f40a0eab
Unverified
Commit
f40a0eab
authored
Oct 21, 2022
by
若依
Committed by
Gitee
Oct 21, 2022
Browse files
!601 swagger-ui静态资源缓存
Merge pull request !601 from abbfun/N/A
parents
a2c585da
78f4d1c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
View file @
f40a0eab
...
...
@@ -33,7 +33,8 @@ public class ResourcesConfig implements WebMvcConfigurer
/** swagger配置 */
registry
.
addResourceHandler
(
"/swagger-ui/**"
)
.
addResourceLocations
(
"classpath:/META-INF/resources/webjars/springfox-swagger-ui/"
);
.
addResourceLocations
(
"classpath:/META-INF/resources/webjars/springfox-swagger-ui/"
)
.
setCacheControl
(
CacheControl
.
maxAge
(
1
,
TimeUnit
.
DAYS
).
mustRevalidate
().
cachePrivate
()).
resourceChain
(
true
);
}
/**
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
View file @
f40a0eab
...
...
@@ -124,6 +124,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 添加CORS filter
httpSecurity
.
addFilterBefore
(
corsFilter
,
JwtAuthenticationTokenFilter
.
class
);
httpSecurity
.
addFilterBefore
(
corsFilter
,
LogoutFilter
.
class
);
// 禁用缓存
httpSecurity
.
headers
().
cacheControl
().
disable
();
}
/**
...
...
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