fix 访客不可主动登陆验证

This commit is contained in:
2025-03-05 12:31:19 +08:00
parent 537c7c5e85
commit c300b5b457
2 changed files with 1 additions and 2 deletions

View File

@@ -128,7 +128,6 @@ public class GainfoFaceService : IGainfoFaceService
.SingleAsync(); .SingleAsync();
gainfo.ThrowIfNull("人员信息不存在"); gainfo.ThrowIfNull("人员信息不存在");
(gainfo.Type == GainfoUserTypeEnumType.External).ThrowIfTrue("人员类型有误,禁止操作");
var face = await _faceDbContext.Queryable<GainfoFaceEntity>().Where(x => x.UserCode == gainfo.Code).SingleAsync(); var face = await _faceDbContext.Queryable<GainfoFaceEntity>().Where(x => x.UserCode == gainfo.Code).SingleAsync();
var taskType = face == null ? DeviceTaskEnumType.Add : DeviceTaskEnumType.Update; var taskType = face == null ? DeviceTaskEnumType.Add : DeviceTaskEnumType.Update;

View File

@@ -249,7 +249,7 @@ public class GainfoService : IGainfoService
{ {
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working).SingleAsync(x => x.IdNo == request.IdNo && x.Name == request.Name); var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working).SingleAsync(x => x.IdNo == request.IdNo && x.Name == request.Name);
gainfo.ThrowIfNull("验证失败!"); gainfo.ThrowIfNull("验证失败!");
(gainfo.Type == GainfoUserTypeEnumType.External).ThrowIfTrue("人员类型有误,禁止操作");
var protector = _dataProtectionProvider.CreateProtector("gainfo:external:idno"); var protector = _dataProtectionProvider.CreateProtector("gainfo:external:idno");
return new return new
{ {