Forráskód Böngészése

异步人脸检测的结果反馈

Michael Wang 6 éve
szülő
commit
37b391eb9e

+ 4 - 4
src/components/FaceRecognition/FaceRecognition.vue

@@ -76,11 +76,12 @@ export default {
       }
     },
     async snapTimer() {
+      const examRecordDataId = this.$route.params.examRecordDataId;
       const captureBlob = await this.getSnapShot();
       const [fileName, captureFilePath] = await this.uploadToServer(
         captureBlob
       );
-      await this.faceCompare(fileName, captureFilePath);
+      await this.faceCompare(fileName, captureFilePath, examRecordDataId);
       this.decreaseSnapCount();
       const video = this.$refs.video;
       video && video.play();
@@ -166,7 +167,7 @@ export default {
         return;
       }
     },
-    async faceCompare(fileName, captureFilePath) {
+    async faceCompare(fileName, captureFilePath, examRecordDataId) {
       try {
         await this.$http.post(
           "/api/ecs_oe_student_face/examCaptureQueue/uploadExamCapture?fileUrl=" +
@@ -174,9 +175,8 @@ export default {
             "&fileName=" +
             fileName +
             "&examRecordDataId=" +
-            this.$route.params.examRecordDataId
+            examRecordDataId
         );
-        const examRecordDataId = this.$route.params.examRecordDataId;
         await this.showSnapResult(fileName, examRecordDataId);
       } catch (e) {
         console.log(e);

+ 1 - 1
src/features/OnlineExam/Examing/FaceId.vue

@@ -179,7 +179,7 @@ export default {
             });
             this.faceTestEndHandle("SUCCESS");
           } else {
-            this.$Message.info({
+            this.$Message.error({
               content: "人脸检测不合格,结束考试",
               duration: 15
             });