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
78f4d1c8
Unverified
Commit
78f4d1c8
authored
Oct 19, 2022
by
abbfun
Committed by
Gitee
Oct 19, 2022
Browse files
swagger-ui静态资源缓存
Signed-off-by:
abbfun
<
819589789@qq.com
>
parent
bf83fe56
Changes
2
Hide whitespace changes
Inline
Side-by-side
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
View file @
78f4d1c8
...
...
@@ -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 @
78f4d1c8
...
...
@@ -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