From 4d6167daa771511958b9dda74c92cda8d5f41cae Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 13 May 2025 15:13:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=9B=B4=E6=96=B0=E7=85=A7=E7=89=87?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=97=B4=E9=9A=94=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Organization/Services/Implements/GainfoFaceService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs index b5b4382c..ce4abe1d 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs @@ -227,12 +227,16 @@ public class GainfoFaceService : IGainfoFaceService var gainfo = await _gainfoStore.Queryable().Where(x => x.No == request.UserNo || x.Code == request.UserNo).SingleAsync(); gainfo.ThrowIfNull("人员档案信息不存在"); + var face = await _faceDbContext.Queryable().Where(x => x.UserCode == gainfo.Code).SingleAsync(); + if (face != null) + { + ((DateTime.Now - face.ModifiedTime).Seconds > 300).ThrowIfFalse("请勿频繁更新照片,请稍后重试"); + } + var userId = _currentUser.GetIntSubjectId(); await DetectFaceImageQualityAsync(request.Face, gainfo.Factory); - var face = await _faceDbContext.Queryable().Where(x => x.UserCode == gainfo.Code).SingleAsync(); - var taskType = face == null ? DeviceTaskEnumType.Add : DeviceTaskEnumType.Update; if (face == null) {