refactor: 禁止 TenantId=0 并改为系统租户

This commit is contained in:
root
2026-01-29 13:16:15 +00:00
parent 77836e270f
commit bc1c4cc41b
4 changed files with 48 additions and 14 deletions

View File

@@ -327,7 +327,7 @@ public sealed class DictionaryAppService(
var tenantId = tenantProvider.GetCurrentTenantId();
if (scope == DictionaryScope.System)
{
EnsurePlatformTenant(tenantId);
EnsureSystemTenant(tenantId);
return 0;
}
@@ -362,9 +362,9 @@ public sealed class DictionaryAppService(
}
}
private void EnsurePlatformTenant(long tenantId)
private void EnsureSystemTenant(long tenantId)
{
// 1. (空行后) 系统字典只能在平台租户TenantId=0上下文中操作
// 1. (空行后) 系统字典只能在系统租户TenantId=0上下文中操作
if (tenantId != 0)
{
throw new BusinessException(ErrorCodes.Forbidden, "租户端不允许操作系统字典");