yzc il y a 1 an
Parent
commit
6e101437d1

+ 2 - 2
hx-tenant/src/main/java/com/fjhx/tenant/controller/tenant/RoleTenantController.java

@@ -88,9 +88,9 @@ public class RoleTenantController extends BaseController {
             throw new ServiceException("您无权操作该数据");
         }
         String tenantId = role.getTenantId();
-        if (!user.isAdmin()) {
+        if (!user.isAdmin() && !user.getTenantId().equals(tenantId)) {
             //非超管 只能改本租户的数据
-            tenantId = SecurityUtils.getTenantId();
+            throw new ServiceException("您无权操作其他租户的数据");
         }
         if (ObjectUtil.isEmpty(tenantId)) {
             throw new ServiceException("租户id不能为空");