作者 RuoYi

修正菜单状态注释信息

@@ -54,7 +54,7 @@ public class SysMenu extends BaseEntity @@ -54,7 +54,7 @@ public class SysMenu extends BaseEntity
54 /** 显示状态(0显示 1隐藏) */ 54 /** 显示状态(0显示 1隐藏) */
55 private String visible; 55 private String visible;
56 56
57 - /** 菜单状态(0显示 1隐藏) */ 57 + /** 菜单状态(0正常 1停用) */
58 private String status; 58 private String status;
59 59
60 /** 权限字符串 */ 60 /** 权限字符串 */
1 package com.ruoyi.framework.config; 1 package com.ruoyi.framework.config;
2 2
  3 +import java.util.concurrent.TimeUnit;
3 import org.springframework.beans.factory.annotation.Autowired; 4 import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.context.annotation.Bean; 5 import org.springframework.context.annotation.Bean;
5 import org.springframework.context.annotation.Configuration; 6 import org.springframework.context.annotation.Configuration;
  7 +import org.springframework.http.CacheControl;
6 import org.springframework.web.cors.CorsConfiguration; 8 import org.springframework.web.cors.CorsConfiguration;
7 import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 9 import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
8 import org.springframework.web.filter.CorsFilter; 10 import org.springframework.web.filter.CorsFilter;
@@ -34,7 +36,7 @@ public class ResourcesConfig implements WebMvcConfigurer @@ -34,7 +36,7 @@ public class ResourcesConfig implements WebMvcConfigurer
34 /** swagger配置 */ 36 /** swagger配置 */
35 registry.addResourceHandler("/swagger-ui/**") 37 registry.addResourceHandler("/swagger-ui/**")
36 .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/") 38 .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
37 - .setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS).mustRevalidate().cachePrivate()).resourceChain(true); 39 + .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic());;
38 } 40 }
39 41
40 /** 42 /**
@@ -102,6 +102,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter @@ -102,6 +102,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
102 httpSecurity 102 httpSecurity
103 // CSRF禁用,因为不使用session 103 // CSRF禁用,因为不使用session
104 .csrf().disable() 104 .csrf().disable()
  105 + // 禁用HTTP响应标头
  106 + .headers().cacheControl().disable().and()
105 // 认证失败处理类 107 // 认证失败处理类
106 .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() 108 .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
107 // 基于token,所以不需要session 109 // 基于token,所以不需要session
@@ -109,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter @@ -109,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
109 // 过滤请求 111 // 过滤请求
110 .authorizeRequests() 112 .authorizeRequests()
111 // 对于登录login 注册register 验证码captchaImage 允许匿名访问 113 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
112 - .antMatchers("/login", "/register", "/captchaImage").anonymous() 114 + .antMatchers("/login", "/register", "/captchaImage").permitAll()
113 // 静态资源,可匿名访问 115 // 静态资源,可匿名访问
114 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() 116 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
115 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() 117 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
@@ -124,8 +126,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter @@ -124,8 +126,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
124 // 添加CORS filter 126 // 添加CORS filter
125 httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class); 127 httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class);
126 httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); 128 httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
127 - // 禁用缓存  
128 - httpSecurity.headers().cacheControl().disable();  
129 } 129 }
130 130
131 /** 131 /**