From 6ab575cd49944863419fe884b3771d9ded558c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Thu, 21 Oct 2021 15:59:34 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E6=96=B9=E6=B3=95=20=E9=87=87=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/config/ResourcesConfig.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 dc7821eed..049f2e1c2 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 @@ -37,12 +37,12 @@ public class ResourcesConfig implements WebMvcConfigurer { // 注册路由拦截器,自定义验证规则 registry.addInterceptor(new SaRouteInterceptor((request, response, handler) -> { // 登录验证 -- 排除多个路径 - SaRouter.match( - //获取所有的 - Collections.singletonList("/**"), - //排除下不需要拦截的 - Arrays.asList(securityProperties.getExcludes()), - () -> { + SaRouter + // 获取所有的 + .match(Collections.singletonList("/**")) + // 排除下不需要拦截的 + .notMatch(Arrays.asList(securityProperties.getExcludes())) + .check(() -> { Long userId = SecurityUtils.getUserId(); if(StringUtils.isNotNull(userId) ) { long tokenTimeout = StpUtil.getTokenTimeout();