From 2f119d2f37907e5f8a060adf28976dbc5c5be542 Mon Sep 17 00:00:00 2001 From: smallchill Date: Mon, 13 Jan 2020 16:34:58 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E7=94=A8=E6=88=B7=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=94=B9=E4=B8=BA=E5=AE=9E=E6=97=B6=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=BC=80=E6=BA=90=E7=89=88?= =?UTF-8?q?=E3=80=81=E5=8D=95=E4=BD=93=E7=89=88=E7=BC=93=E5=AD=98=E5=BD=B1?= =?UTF-8?q?=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/user/service/impl/UserServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java index 8acbdf9d..1e0ceb58 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java @@ -24,6 +24,7 @@ import org.springblade.common.constant.CommonConstant; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.SecureUtil; +import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DigestUtil; @@ -31,6 +32,7 @@ import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.cache.SysCache; import org.springblade.system.entity.Tenant; +import org.springblade.system.feign.ISysClient; import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.UserDept; import org.springblade.system.user.entity.UserInfo; @@ -53,6 +55,7 @@ import java.util.List; public class UserServiceImpl extends BaseServiceImpl implements IUserService { private IUserDeptService userDeptService; + private ISysClient sysClient; @Override @Transactional(rollbackFor = Exception.class) @@ -111,8 +114,11 @@ public class UserServiceImpl extends BaseServiceImpl implement User user = baseMapper.getUser(tenantId, account); userInfo.setUser(user); if (Func.isNotEmpty(user)) { - List roleAlias = SysCache.getRoleAliases(user.getRoleId()); - userInfo.setRoles(roleAlias); + R> result = sysClient.getRoleAliases(user.getRoleId()); + if (result.isSuccess()) { + List roleAlias = result.getData(); + userInfo.setRoles(roleAlias); + } } return userInfo; }