Quellcode durchsuchen

Merge branch 'dev'

yangdamao vor 1 Jahr
Ursprung
Commit
e5fc1ce8b4

+ 6 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/tencentcloud/service/impl/FaceOcrServiceImpl.java

@@ -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;
     }