|
@@ -160,6 +160,12 @@ public class WebTenantGatewayImpl implements WebTenantGateway {
|
|
|
@Transactional
|
|
|
public void addTenantAdmin(TenantAdminAddParam req) {
|
|
|
|
|
|
+ // 校验当前角色 是否属于当前租户
|
|
|
+ TblRole role = tblRoleService.getById(req.getRoleId());
|
|
|
+ if (role == null || !req.getTenantId().equals(role.getTenantId())) {
|
|
|
+ throw new BizException(ErrorEnum.ROLE_NOT_BELONG_TENANT.getErrorCode(), ErrorEnum.ROLE_NOT_BELONG_TENANT.getErrorMessage());
|
|
|
+ }
|
|
|
+
|
|
|
if (req.getUserId() == null) {
|
|
|
// 1. 检查账号是否已存在
|
|
|
AdminUserInfo exist = adminUserService.queryByAccount(req.getAccount());
|