|
@@ -326,12 +326,17 @@ public class WebGatewayImpl implements WebGateway {
|
|
// 3 添加 SptAdminUtil,不过在不同地方,需要注意对 stputil sptadminutil 的不同引用
|
|
// 3 添加 SptAdminUtil,不过在不同地方,需要注意对 stputil sptadminutil 的不同引用
|
|
StpUtil.login(RedisCacheConstant.WEB_USER_PRE + adminUser.getUserId(), DeviceType.WEB.getCode());
|
|
StpUtil.login(RedisCacheConstant.WEB_USER_PRE + adminUser.getUserId(), DeviceType.WEB.getCode());
|
|
|
|
|
|
|
|
+ // 查询登录用户的roleId
|
|
|
|
+ TblUserRole userRole = tblUserRoleService.getByUserId(adminUser.getUserId());
|
|
|
|
+ Long roleId = userRole.getRoleId();
|
|
|
|
+
|
|
// 用户登录后,保存用户信息到 session
|
|
// 用户登录后,保存用户信息到 session
|
|
SaSession saSession = StpUtil.getSession();
|
|
SaSession saSession = StpUtil.getSession();
|
|
saSession.set(UserConstants.SA_USER_PHONE, adminUser.getPhone());
|
|
saSession.set(UserConstants.SA_USER_PHONE, adminUser.getPhone());
|
|
saSession.set(UserConstants.SA_USER_ID, adminUser.getUserId());
|
|
saSession.set(UserConstants.SA_USER_ID, adminUser.getUserId());
|
|
saSession.set(UserConstants.SA_USER_TYPE, adminUser.getUserType());
|
|
saSession.set(UserConstants.SA_USER_TYPE, adminUser.getUserType());
|
|
saSession.set(UserConstants.SA_USER_ACCOUNT, adminUser.getAccount());
|
|
saSession.set(UserConstants.SA_USER_ACCOUNT, adminUser.getAccount());
|
|
|
|
+ saSession.set(UserConstants.SA_USER_ROLE_ID, roleId);
|
|
if (adminUser.getTenantId() != null) {
|
|
if (adminUser.getTenantId() != null) {
|
|
saSession.set(UserConstants.SA_USER_TENANT_ID, adminUser.getTenantId());
|
|
saSession.set(UserConstants.SA_USER_TENANT_ID, adminUser.getTenantId());
|
|
}
|
|
}
|