From b6af5f2e934ec283afc5fb5455319139e6ace1cf Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 28 Oct 2025 11:24:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=87=8F=E5=B0=91=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Basic/Organization/Api/IHainingApi.cs | 2 +- .../Organization/Services/Implements/GainfoFaceService.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Api/IHainingApi.cs b/Src/Dlhis.Basic/Organization/Api/IHainingApi.cs index 52ff8c95..2fe53b80 100644 --- a/Src/Dlhis.Basic/Organization/Api/IHainingApi.cs +++ b/Src/Dlhis.Basic/Organization/Api/IHainingApi.cs @@ -8,5 +8,5 @@ public interface IHainingApi { [RequestLog] [Post("/jingke/api/face/SaveFaceByFace")] - Task UploadAsync(HainingApiUploadRequest request); + Task UploadAsync(HainingApiUploadRequest request); } \ No newline at end of file diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs index cbba5239..d7c4bdac 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs @@ -250,6 +250,7 @@ public class GainfoFaceService : IGainfoFaceService var timeLimitedDataProtector = _dataProtectionProvider.CreateProtector("down:face").ToTimeLimitedDataProtector(); try { + //解密token,如果非法和过期会抛异常 var password = timeLimitedDataProtector.Unprotect(token); var userCode = password.Split(':')[1]; @@ -262,9 +263,10 @@ public class GainfoFaceService : IGainfoFaceService return new FileContentResult(Convert.FromBase64String(face.Face), "image/png"); } - catch (Exception ex) + catch { - _logger.LogError(ex, "获取人脸失败:{message}", ex.Message); + //已经验证没有问题,后续不需要输出多余日志 + //_logger.LogError(ex, "获取人脸失败:{message}", ex.Message); return new NotFoundResult(); } }