From 1d1a241ad4d1809920229a30568a24ac402ea1c0 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 11 Apr 2024 13:17:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=A7=BB=E9=99=A4tenantId=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Organization/Controllers/GainfosController.cs | 1 + .../Services/Implements/GainfoService.cs | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs index 7c1eed49..84068abb 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs @@ -62,6 +62,7 @@ public class GainfosController : ControllerBase /// /// [HttpGet("current")] + [IgnoreTenant] public async Task CurrentUserInfoAsync() { return await _gainfoService.CurrentUserInfoAsync(); diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 0d6e9e3d..8e152fb7 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -212,10 +212,16 @@ public class GainfoService : IGainfoService if (info != null) { - var tenantResult = await _tenantApi.GetTenantByCodeAsync(info.Factory); - if (tenantResult != null && tenantResult.Data != null) + try + { + var tenantResult = await _tenantApi.GetTenantByCodeAsync(info.Factory); + if (tenantResult != null && tenantResult.Data != null) + { + info.Factory = tenantResult.Data.Name; + } + } + catch (Exception) { - info.Factory = tenantResult.Data.Name; } }