From 2275380e00e8510cbcc39634f5fdeb219e41e52d 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 00:46:38 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DBC=E7=AB=AF=E9=89=B4=E6=9D=83=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E6=84=9F=E8=B0=A2=E7=A0=81=E4=BA=91=E5=B0=8F=E4=BC=99?= =?UTF-8?q?=EF=BC=88=E5=8F=AF=E8=BE=BE=E9=B8=AD=E7=BB=99=E6=88=91=E5=86=B2?= =?UTF-8?q?=E9=B8=AD=EF=BC=89=20https://gitee.com/xiaonuobase/snowy/issues?= =?UTF-8?q?/I62WRX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vip/xiaonuo/auth/core/config/AuthConfigure.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/core/config/AuthConfigure.java b/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/core/config/AuthConfigure.java index 532ba60e..7c2fd1bb 100644 --- a/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/core/config/AuthConfigure.java +++ b/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/core/config/AuthConfigure.java @@ -32,6 +32,7 @@ import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import vip.xiaonuo.auth.core.enums.SaClientTypeEnum; +import vip.xiaonuo.auth.core.util.StpClientLoginUserUtil; import vip.xiaonuo.auth.core.util.StpLoginUserUtil; import vip.xiaonuo.common.pojo.CommonResult; @@ -100,7 +101,11 @@ public class AuthConfigure implements WebMvcConfigurer { */ @Override public List getPermissionList(Object loginId, String loginType) { - return StpLoginUserUtil.getLoginUser().getPermissionCodeList(); + if (SaClientTypeEnum.B.getValue().equals(loginType)) { + return StpLoginUserUtil.getLoginUser().getPermissionCodeList(); + } else { + return StpClientLoginUserUtil.getClientLoginUser().getPermissionCodeList(); + } } /** @@ -108,7 +113,11 @@ public class AuthConfigure implements WebMvcConfigurer { */ @Override public List getRoleList(Object loginId, String loginType) { - return StpLoginUserUtil.getLoginUser().getRoleCodeList(); + if (SaClientTypeEnum.B.getValue().equals(loginType)) { + return StpLoginUserUtil.getLoginUser().getRoleCodeList(); + } else { + return StpClientLoginUserUtil.getClientLoginUser().getRoleCodeList(); + } } }