!601 swagger-ui静态资源缓存

Merge pull request !601 from abbfun/N/A
master
若依 2 years ago committed by Gitee
commit f40a0eab23
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
  1. 3
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
  2. 2
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@ -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);
}
/**

@ -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();
}
/**

Loading…
Cancel
Save