mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-04 03:26:31 +00:00
!60 替换Sa-Token#SaIdUtil过期的代码工具,修改替换后的配置项,修复白名单不生效的问题
Merge pull request !60 from 书中自有颜如玉/dev
This commit is contained in:
@@ -172,8 +172,8 @@ sa-token:
|
||||
activity-timeout: 1800
|
||||
# 开启内网服务调用鉴权
|
||||
check-same-token: true
|
||||
# Id-Token的有效期 (单位: 秒)
|
||||
id-token-timeout: 600
|
||||
# Same-Token的有效期 (单位: 秒)
|
||||
same-token-timeout: 600
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package com.ruoyi.common.security.config;
|
||||
|
||||
import cn.dev33.satoken.filter.SaServletFilter;
|
||||
import cn.dev33.satoken.id.SaIdUtil;
|
||||
import cn.dev33.satoken.interceptor.SaInterceptor;
|
||||
import cn.dev33.satoken.same.SaSameUtil;
|
||||
import cn.dev33.satoken.util.SaResult;
|
||||
import com.ruoyi.common.core.constant.HttpStatus;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
@@ -35,7 +35,7 @@ public class SecurityConfiguration implements WebMvcConfigurer {
|
||||
return new SaServletFilter()
|
||||
.addInclude("/**")
|
||||
.addExclude("/actuator/**")
|
||||
.setAuth(obj -> SaIdUtil.checkCurrentRequestToken())
|
||||
.setAuth(obj -> SaSameUtil.checkCurrentRequestToken())
|
||||
.setError(e -> SaResult.error("认证失败,无法访问系统资源").setCode(HttpStatus.UNAUTHORIZED));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user