Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
e2139687
提交
e2139687
authored
10月 21, 2022
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修正菜单状态注释信息
上级
b67f6a0f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
7 行增加
和
5 行删除
+7
-5
SysMenu.java
...ain/java/com/ruoyi/common/core/domain/entity/SysMenu.java
+1
-1
ResourcesConfig.java
...main/java/com/ruoyi/framework/config/ResourcesConfig.java
+3
-1
SecurityConfig.java
.../main/java/com/ruoyi/framework/config/SecurityConfig.java
+3
-3
没有找到文件。
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
浏览文件 @
e2139687
...
@@ -54,7 +54,7 @@ public class SysMenu extends BaseEntity
...
@@ -54,7 +54,7 @@ public class SysMenu extends BaseEntity
/** 显示状态(0显示 1隐藏) */
/** 显示状态(0显示 1隐藏) */
private
String
visible
;
private
String
visible
;
/** 菜单状态(0
显示 1隐藏
) */
/** 菜单状态(0
正常 1停用
) */
private
String
status
;
private
String
status
;
/** 权限字符串 */
/** 权限字符串 */
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
浏览文件 @
e2139687
package
com
.
ruoyi
.
framework
.
config
;
package
com
.
ruoyi
.
framework
.
config
;
import
java.util.concurrent.TimeUnit
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.CacheControl
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
org.springframework.web.filter.CorsFilter
;
...
@@ -34,7 +36,7 @@ public class ResourcesConfig implements WebMvcConfigurer
...
@@ -34,7 +36,7 @@ public class ResourcesConfig implements WebMvcConfigurer
/** swagger配置 */
/** swagger配置 */
registry
.
addResourceHandler
(
"/swagger-ui/**"
)
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
)
;
.
setCacheControl
(
CacheControl
.
maxAge
(
5
,
TimeUnit
.
HOURS
).
cachePublic
());
;
}
}
/**
/**
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
浏览文件 @
e2139687
...
@@ -102,6 +102,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
...
@@ -102,6 +102,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
httpSecurity
httpSecurity
// CSRF禁用,因为不使用session
// CSRF禁用,因为不使用session
.
csrf
().
disable
()
.
csrf
().
disable
()
// 禁用HTTP响应标头
.
headers
().
cacheControl
().
disable
().
and
()
// 认证失败处理类
// 认证失败处理类
.
exceptionHandling
().
authenticationEntryPoint
(
unauthorizedHandler
).
and
()
.
exceptionHandling
().
authenticationEntryPoint
(
unauthorizedHandler
).
and
()
// 基于token,所以不需要session
// 基于token,所以不需要session
...
@@ -109,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
...
@@ -109,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
// 过滤请求
.
authorizeRequests
()
.
authorizeRequests
()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.
antMatchers
(
"/login"
,
"/register"
,
"/captchaImage"
).
anonymous
()
.
antMatchers
(
"/login"
,
"/register"
,
"/captchaImage"
).
permitAll
()
// 静态资源,可匿名访问
// 静态资源,可匿名访问
.
antMatchers
(
HttpMethod
.
GET
,
"/"
,
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
,
"/profile/**"
).
permitAll
()
.
antMatchers
(
HttpMethod
.
GET
,
"/"
,
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
,
"/profile/**"
).
permitAll
()
.
antMatchers
(
"/swagger-ui.html"
,
"/swagger-resources/**"
,
"/webjars/**"
,
"/*/api-docs"
,
"/druid/**"
).
permitAll
()
.
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
// 添加CORS filter
// 添加CORS filter
httpSecurity
.
addFilterBefore
(
corsFilter
,
JwtAuthenticationTokenFilter
.
class
);
httpSecurity
.
addFilterBefore
(
corsFilter
,
JwtAuthenticationTokenFilter
.
class
);
httpSecurity
.
addFilterBefore
(
corsFilter
,
LogoutFilter
.
class
);
httpSecurity
.
addFilterBefore
(
corsFilter
,
LogoutFilter
.
class
);
// 禁用缓存
httpSecurity
.
headers
().
cacheControl
().
disable
();
}
}
/**
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论