From db2ef88c5f3ade60188f1b5b3819357812d044df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=AF=BA?= <1253070437@qq.com> Date: Sun, 4 Dec 2022 01:29:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91BC=E7=AB=AF?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=9D=83=E9=99=90=E4=BE=8B=E5=AD=90=E6=9B=B4?= =?UTF-8?q?=E6=98=8E=E7=A1=AE=20https://gitee.com/xiaonuobase/snowy/issues?= =?UTF-8?q?/I63AJ2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vip/xiaonuo/core/config/GlobalConfigure.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/snowy-web-app/src/main/java/vip/xiaonuo/core/config/GlobalConfigure.java b/snowy-web-app/src/main/java/vip/xiaonuo/core/config/GlobalConfigure.java index c1cd344b..ec0a1cae 100644 --- a/snowy-web-app/src/main/java/vip/xiaonuo/core/config/GlobalConfigure.java +++ b/snowy-web-app/src/main/java/vip/xiaonuo/core/config/GlobalConfigure.java @@ -170,6 +170,14 @@ public class GlobalConfigure implements WebMvcConfigurer { "/dev/sms/detail", }; + /** + * B端要排除的,相当于C端要认证的 + */ + private static final String[] CLIENT_USER_PERMISSION_PATH_ARR = { + "/auth/c/**", + "/client/c/**" + }; + /** * 注册跨域过滤器 */ @@ -186,7 +194,7 @@ public class GlobalConfigure implements WebMvcConfigurer { // 排除无需登录接口 .notMatch(CollectionUtil.newArrayList(NO_LOGIN_PATH_ARR)) // 排除C端认证接口 - .notMatch("/auth/c/**") + .notMatch(CollectionUtil.newArrayList(CLIENT_USER_PERMISSION_PATH_ARR)) // 校验B端登录 .check(r1 -> StpUtil.checkLogin()); @@ -195,7 +203,7 @@ public class GlobalConfigure implements WebMvcConfigurer { // 排除无需登录接口 .notMatch(CollectionUtil.newArrayList(NO_LOGIN_PATH_ARR)) // 匹配C端认证接口 - .match("/auth/c/**") + .match(CollectionUtil.newArrayList(CLIENT_USER_PERMISSION_PATH_ARR)) // 校验C端登录 .check(r1 -> StpClientUtil.checkLogin());