fix 减少异常日志输出
This commit is contained in:
@@ -8,5 +8,5 @@ public interface IHainingApi
|
|||||||
{
|
{
|
||||||
[RequestLog]
|
[RequestLog]
|
||||||
[Post("/jingke/api/face/SaveFaceByFace")]
|
[Post("/jingke/api/face/SaveFaceByFace")]
|
||||||
Task<object> UploadAsync(HainingApiUploadRequest request);
|
Task UploadAsync(HainingApiUploadRequest request);
|
||||||
}
|
}
|
||||||
@@ -250,6 +250,7 @@ public class GainfoFaceService : IGainfoFaceService
|
|||||||
var timeLimitedDataProtector = _dataProtectionProvider.CreateProtector("down:face").ToTimeLimitedDataProtector();
|
var timeLimitedDataProtector = _dataProtectionProvider.CreateProtector("down:face").ToTimeLimitedDataProtector();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//解密token,如果非法和过期会抛异常
|
||||||
var password = timeLimitedDataProtector.Unprotect(token);
|
var password = timeLimitedDataProtector.Unprotect(token);
|
||||||
var userCode = password.Split(':')[1];
|
var userCode = password.Split(':')[1];
|
||||||
|
|
||||||
@@ -262,9 +263,10 @@ public class GainfoFaceService : IGainfoFaceService
|
|||||||
|
|
||||||
return new FileContentResult(Convert.FromBase64String(face.Face), "image/png");
|
return new FileContentResult(Convert.FromBase64String(face.Face), "image/png");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "获取人脸失败:{message}", ex.Message);
|
//已经验证没有问题,后续不需要输出多余日志
|
||||||
|
//_logger.LogError(ex, "获取人脸失败:{message}", ex.Message);
|
||||||
return new NotFoundResult();
|
return new NotFoundResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user