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