deason 2 лет назад
Родитель
Сommit
2a41a3e569

+ 3 - 3
examcloud-core-oe-student-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/student/api/controller/ExamCaptureController.java

@@ -94,9 +94,9 @@ public class ExamCaptureController extends ControllerSupport {
             throw new StatusException("500503", "人脸验证太频繁,请10分钟后重试!");
         }
 
-        CompareFaceSyncInfo compareFaceSyncInfo = examCaptureService.compareFaceSyncByFileUrl(user.getUserId(), baseFaceToken, fileUrl);
-        // CompareFaceSyncInfo compareFaceSyncInfo = examCaptureService.compareFaceSync(studentCache, fileUrl);
-        log.warn("compareFaceSyncResult isPass = {}, fileUrl = {}, errorMsg = {}", compareFaceSyncInfo.getIsPass(), fileUrl, compareFaceSyncInfo.getErrorMsg());
+        CompareFaceSyncInfo compareFaceSyncInfo = examCaptureService.compareFaceSync(studentCache, fileUrl);
+        // CompareFaceSyncInfo compareFaceSyncInfo = examCaptureService.compareFaceSyncByFileUrl(user.getUserId(), baseFaceToken, fileUrl);
+        // log.warn("compareFaceSyncResult isPass = {}, fileUrl = {}, errorMsg = {}", compareFaceSyncInfo.getIsPass(), fileUrl, compareFaceSyncInfo.getErrorMsg());
 
         //将人脸同步比较的结果临时存储到redis中.开考后会清除
         String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);

+ 5 - 5
examcloud-core-oe-student-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/service/impl/ExamCaptureServiceImpl.java

@@ -173,7 +173,7 @@ public class ExamCaptureServiceImpl implements ExamCaptureService {
     @Override
     public CompareFaceSyncInfo compareFaceSync(StudentCacheBean student, String fileUrl) {
         // 获取学校人脸API方案配置 todo
-        boolean useBaiduApi = true;
+        boolean useBaiduApi = false;
         double baiduExpectFaceCompareScore = 70d;
 
         CompareFaceSyncInfo info = new CompareFaceSyncInfo();
@@ -202,14 +202,14 @@ public class ExamCaptureServiceImpl implements ExamCaptureService {
                 info.setErrorMsg("检测过程中存在多人脸");
             }
 
-            log.warn("[compareFaceSync] {} pass = {}, fileUrl = {}, error = {}", useBaiduApi ? "baidu" : "face++",
-                    info.getIsPass(), fileUrl, faceResult.getError());
+            log.warn("[compareFaceSync] {} pass:{}, api:{} {}", fileUrl, info.getIsPass(),
+                    useBaiduApi ? "baidu" : "face++", faceResult.getError());
         } catch (Exception e) {
             info.setExistsSystemError(true);
             info.setErrorMsg(e.getMessage());
 
-            log.error("[compareFaceSync] {} pass = {}, fileUrl = {}, error = {}", useBaiduApi ? "baidu" : "face++",
-                    info.getIsPass(), fileUrl, e.getMessage());
+            log.error("[compareFaceSync] {} pass:{}, api:{} error:{}", fileUrl, info.getIsPass(),
+                    useBaiduApi ? "baidu" : "face++", e.getMessage());
         }
 
         return info;