|
@@ -102,11 +102,15 @@ public class FaceOcrServiceImpl implements IFaceOcrService {
|
|
|
faceRequest.setUrlB(oneInchPhotos); //一寸近照
|
|
|
faceRequest.setQualityControl(2L);
|
|
|
CompareFaceResponse response = iaiClient.CompareFace(faceRequest);
|
|
|
+ if (response.getScore().intValue() < 65){
|
|
|
+ throw new CustomException("人脸识别不通过,请重新拍照!",606);
|
|
|
+ }
|
|
|
return response.getScore().intValue();
|
|
|
}
|
|
|
return 0;
|
|
|
}catch (TencentCloudSDKException e){
|
|
|
- return 0;
|
|
|
+// return 0;
|
|
|
+ throw new CustomException(e.getMessage(),606);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -181,8 +185,7 @@ public class FaceOcrServiceImpl implements IFaceOcrService {
|
|
|
throw new CustomException("请保证人脸全部在照片范围内!");
|
|
|
}
|
|
|
}catch (TencentCloudSDKException e){
|
|
|
- log.info("人脸检测错误"+e.getMessage());
|
|
|
- throw new CustomException("人脸检测错误"+e.getMessage());
|
|
|
+ throw new CustomException("人脸检测错误:"+e.getMessage());
|
|
|
}
|
|
|
return true;
|
|
|
}
|