|
@@ -16,6 +16,7 @@ import com.hfln.portal.domain.customer.util.CopyUtils;
|
|
import com.hfln.portal.domain.customer.util.PasswordUtil;
|
|
import com.hfln.portal.domain.customer.util.PasswordUtil;
|
|
import com.hfln.portal.domain.exception.ErrorEnum;
|
|
import com.hfln.portal.domain.exception.ErrorEnum;
|
|
import com.hfln.portal.domain.gateway.WebUserGateway;
|
|
import com.hfln.portal.domain.gateway.WebUserGateway;
|
|
|
|
+import com.hfln.portal.infrastructure.config.UserContext;
|
|
import com.hfln.portal.infrastructure.po.AdminUserInfo;
|
|
import com.hfln.portal.infrastructure.po.AdminUserInfo;
|
|
import com.hfln.portal.infrastructure.po.TblUserRole;
|
|
import com.hfln.portal.infrastructure.po.TblUserRole;
|
|
import com.hfln.portal.infrastructure.service.AdminUserService;
|
|
import com.hfln.portal.infrastructure.service.AdminUserService;
|
|
@@ -49,8 +50,8 @@ public class WebUserGatewayImpl implements WebUserGateway {
|
|
public PageRecord<AdminUserDto> queryManager(QueryManagerParam param) {
|
|
public PageRecord<AdminUserDto> queryManager(QueryManagerParam param) {
|
|
|
|
|
|
// 对 后台超级管理员 和用户超级管理员 进行权限控制
|
|
// 对 后台超级管理员 和用户超级管理员 进行权限控制
|
|
- String userType = (String) StpUtil.getSession().get(UserConstants.SA_USER_TYPE);
|
|
|
|
- Long tenantId = (Long) StpUtil.getSession().get(UserConstants.SA_USER_TENANT_ID);
|
|
|
|
|
|
+ String userType = UserContext.getUserType();
|
|
|
|
+ Long tenantId = UserContext.getTenantId();
|
|
log.info("当前登录用户类型:userType:{}, tenantId:{}", userType, tenantId);
|
|
log.info("当前登录用户类型:userType:{}, tenantId:{}", userType, tenantId);
|
|
if (tenantId != null) {
|
|
if (tenantId != null) {
|
|
param.setTenantId(tenantId);
|
|
param.setTenantId(tenantId);
|
|
@@ -67,7 +68,7 @@ public class WebUserGatewayImpl implements WebUserGateway {
|
|
@Transactional
|
|
@Transactional
|
|
public void addManager(AddAccountParam param) {
|
|
public void addManager(AddAccountParam param) {
|
|
|
|
|
|
- Long tenantId = (Long) StpUtil.getSession().get(UserConstants.SA_USER_TENANT_ID);
|
|
|
|
|
|
+ Long tenantId = UserContext.getTenantId();
|
|
if (tenantId != null) {
|
|
if (tenantId != null) {
|
|
param.setTenantId(tenantId);
|
|
param.setTenantId(tenantId);
|
|
}
|
|
}
|
|
@@ -78,7 +79,7 @@ public class WebUserGatewayImpl implements WebUserGateway {
|
|
}
|
|
}
|
|
|
|
|
|
// 对 后台超级管理员 和用户超级管理员 进行权限控制
|
|
// 对 后台超级管理员 和用户超级管理员 进行权限控制
|
|
- String userType = (String) StpUtil.getSession().get(UserConstants.SA_USER_TYPE);
|
|
|
|
|
|
+ String userType = UserContext.getUserType();
|
|
log.info("当前登录用户类型:userType:{}", userType);
|
|
log.info("当前登录用户类型:userType:{}", userType);
|
|
|
|
|
|
// 如果创建的用户类型为普通用户,则需要指定租户id
|
|
// 如果创建的用户类型为普通用户,则需要指定租户id
|
|
@@ -106,7 +107,7 @@ public class WebUserGatewayImpl implements WebUserGateway {
|
|
@Transactional
|
|
@Transactional
|
|
public void modManager(AdminModParam param) {
|
|
public void modManager(AdminModParam param) {
|
|
|
|
|
|
- Long tenantId = (Long) StpUtil.getSession().get(UserConstants.SA_USER_TENANT_ID);
|
|
|
|
|
|
+ Long tenantId = UserContext.getTenantId();
|
|
if (tenantId != null) {
|
|
if (tenantId != null) {
|
|
param.setTenantId(tenantId);
|
|
param.setTenantId(tenantId);
|
|
}
|
|
}
|
|
@@ -124,7 +125,7 @@ public class WebUserGatewayImpl implements WebUserGateway {
|
|
}
|
|
}
|
|
|
|
|
|
// 对 后台超级管理员 和用户超级管理员 进行权限控制
|
|
// 对 后台超级管理员 和用户超级管理员 进行权限控制
|
|
- String userType = (String) StpUtil.getSession().get(UserConstants.SA_USER_TYPE);
|
|
|
|
|
|
+ String userType = UserContext.getUserType();
|
|
log.info("当前登录用户类型:userType:{}", userType);
|
|
log.info("当前登录用户类型:userType:{}", userType);
|
|
|
|
|
|
// 如果修改的用户类型为普通用户,则需要指定租户id
|
|
// 如果修改的用户类型为普通用户,则需要指定租户id
|
|
@@ -159,7 +160,7 @@ public class WebUserGatewayImpl implements WebUserGateway {
|
|
throw new BizException(ErrorEnum.USER_IS_NOT_EXIST.getErrorCode(), ErrorEnum.USER_IS_NOT_EXIST.getErrorMessage());
|
|
throw new BizException(ErrorEnum.USER_IS_NOT_EXIST.getErrorCode(), ErrorEnum.USER_IS_NOT_EXIST.getErrorMessage());
|
|
}
|
|
}
|
|
// 对 后台超级管理员 和用户超级管理员 进行权限控制
|
|
// 对 后台超级管理员 和用户超级管理员 进行权限控制
|
|
- String userType = (String) StpUtil.getSession().get(UserConstants.SA_USER_TYPE);
|
|
|
|
|
|
+ String userType = UserContext.getUserType();
|
|
log.info("当前登录用户类型:userType:{}", userType);
|
|
log.info("当前登录用户类型:userType:{}", userType);
|
|
|
|
|
|
check(userType, exist.getUserType());
|
|
check(userType, exist.getUserType());
|