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) {