From 187534ecca5c28c1c96848239238731b28220348 Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Wed, 21 Jan 2026 17:21:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=81=E8=AE=B8=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E8=B7=A8=E7=A7=9F=E6=88=B7=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Stores/Handlers/UpdateStoreCommandHandler.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Application/TakeoutSaaS.Application/App/Stores/Handlers/UpdateStoreCommandHandler.cs b/src/Application/TakeoutSaaS.Application/App/Stores/Handlers/UpdateStoreCommandHandler.cs index 69f8133..f514e15 100644 --- a/src/Application/TakeoutSaaS.Application/App/Stores/Handlers/UpdateStoreCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Stores/Handlers/UpdateStoreCommandHandler.cs @@ -1,4 +1,5 @@ using MediatR; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using TakeoutSaaS.Application.App.Stores; using TakeoutSaaS.Application.App.Stores.Commands; @@ -18,6 +19,7 @@ namespace TakeoutSaaS.Application.App.Stores.Handlers; public sealed class UpdateStoreCommandHandler( IStoreRepository storeRepository, ITenantProvider tenantProvider, + IHttpContextAccessor httpContextAccessor, ILogger logger) : IRequestHandler { @@ -25,7 +27,8 @@ public sealed class UpdateStoreCommandHandler( public async Task Handle(UpdateStoreCommand request, CancellationToken cancellationToken) { // 1. 读取门店 - var tenantId = tenantProvider.GetCurrentTenantId(); + var ignoreTenantFilter = StoreTenantAccess.ShouldIgnoreTenantFilter(httpContextAccessor); + var tenantId = ignoreTenantFilter ? 0 : tenantProvider.GetCurrentTenantId(); var existing = await storeRepository.FindByIdAsync(request.StoreId, tenantId, cancellationToken); if (existing == null) {