diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml index 83158d43..e85ff7ba 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml @@ -35,7 +35,7 @@ diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java index e0fbada4..fbf5d64c 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java @@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.exceptions.ApiException; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.node.ForestNodeMerger; import org.springblade.core.tool.utils.Func; @@ -47,6 +48,9 @@ public class DeptServiceImpl extends ServiceImpl implements ID @Override public List tree(String tenantId) { + if (AuthUtil.isAdministrator()) { + tenantId = StringPool.EMPTY; + } return ForestNodeMerger.merge(baseMapper.tree(tenantId)); }