From e21396870f5e1167dc6bf861e4421120d04f657a Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期五, 21 十月 2022 11:56:15 +0800 Subject: [PATCH] 修正菜单状态注释信息 --- ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java | 2 +- ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java | 4 +++- ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java index 229f418..9f3a6f6 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java @@ -54,7 +54,7 @@ /** 鏄剧ず鐘舵�侊紙0鏄剧ず 1闅愯棌锛� */ private String visible; - /** 鑿滃崟鐘舵�侊紙0鏄剧ず 1闅愯棌锛� */ + /** 鑿滃崟鐘舵�侊紙0姝e父 1鍋滅敤锛� */ private String status; /** 鏉冮檺瀛楃涓� */ diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java index ff1a5e5..4e067a7 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java @@ -1,8 +1,10 @@ package com.ruoyi.framework.config; +import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.http.CacheControl; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; @@ -34,7 +36,7 @@ /** swagger閰嶇疆 */ registry.addResourceHandler("/swagger-ui/**") .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/") - .setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS).mustRevalidate().cachePrivate()).resourceChain(true); + .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic());; } /** diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 3f7fc67..bdb7199 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -102,6 +102,8 @@ httpSecurity // CSRF绂佺敤锛屽洜涓轰笉浣跨敤session .csrf().disable() + // 绂佺敤HTTP鍝嶅簲鏍囧ご + .headers().cacheControl().disable().and() // 璁よ瘉澶辫触澶勭悊绫� .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() // 鍩轰簬token锛屾墍浠ヤ笉闇�瑕乻ession @@ -109,7 +111,7 @@ // 杩囨护璇锋眰 .authorizeRequests() // 瀵逛簬鐧诲綍login 娉ㄥ唽register 楠岃瘉鐮乧aptchaImage 鍏佽鍖垮悕璁块棶 - .antMatchers("/login", "/register", "/captchaImage").anonymous() + .antMatchers("/login", "/register", "/captchaImage").permitAll() // 闈欐�佽祫婧愶紝鍙尶鍚嶈闂� .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() @@ -124,8 +126,6 @@ // 娣诲姞CORS filter httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class); httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); - // 绂佺敤缂撳瓨 - httpSecurity.headers().cacheControl().disable(); } /** -- Gitblit v1.9.3