fix: .
This commit is contained in:
@@ -9,4 +9,11 @@ public class IdCardFaceCompareRequest
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "用户code不可为空")]
|
||||
public string UserCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人脸图片base64
|
||||
/// </summary>
|
||||
|
||||
[Required]
|
||||
public string Face { get; set; }
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ public class GainfoIdCardFaceCompareService : IGainfoIdCardFaceCompareService
|
||||
|
||||
public GainfoIdCardFaceCompareService(
|
||||
IDbContext dbContext,
|
||||
IServiceProvider serviceProvider,
|
||||
IAliyunClient aliyunClient,
|
||||
ICurrentUser currentUser)
|
||||
{
|
||||
@@ -121,17 +120,8 @@ public class GainfoIdCardFaceCompareService : IGainfoIdCardFaceCompareService
|
||||
await UpdateRecordErrorAndThrowAsync(record, "人员证件号为空,无法对比", userId);
|
||||
}
|
||||
|
||||
var face = string.Empty;
|
||||
using (var scope = _serviceProvider.CreateScope())
|
||||
{
|
||||
var faceDbContext = scope.ServiceProvider.GetService<IDbContext>().ChangeDb("face");
|
||||
face = await faceDbContext.Queryable<GainfoFaceEntity>()
|
||||
.Where(x => x.UserCode == gainfo.Code)
|
||||
.Select(x => x.Face)
|
||||
.SingleAsync();
|
||||
}
|
||||
|
||||
if (!face.IsPresent())
|
||||
if (!request.Face.IsPresent())
|
||||
{
|
||||
await UpdateRecordErrorAndThrowAsync(record, "人脸照片尚未录入", userId);
|
||||
}
|
||||
@@ -139,7 +129,7 @@ public class GainfoIdCardFaceCompareService : IGainfoIdCardFaceCompareService
|
||||
AliyunId3MetaVerifyResponse response;
|
||||
try
|
||||
{
|
||||
response = await _aliyunClient.Id3MetaVerifyAsync(gainfo.IdNo, gainfo.Name, face);
|
||||
response = await _aliyunClient.Id3MetaVerifyAsync(gainfo.IdNo, gainfo.Name, request.Face);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user