Bläddra i källkod

fix活体检测新api

Michael Wang 6 år sedan
förälder
incheckning
1c87d505ef

+ 3 - 0
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -24,6 +24,9 @@
       </p>
     </Modal>
   </div>
+  <div v-else>
+    正在等待数据返回...
+  </div>
 </template>
 
 <script>

+ 9 - 4
src/features/OnlineExam/Examing/FaceId.vue

@@ -58,7 +58,7 @@ export default {
     updateFaceVerify(errorMsg, redoMsg) {
       this.showRedo(redoMsg);
       this.$http.get(
-        "/api/face_verify/updateFaceVerify/" +
+        "/api/ecs_oe_student/examFaceLivenessVerify/updateFaceLivenessVerify/" +
           this.$route.params.examRecordDataId,
         { params: { errorMsg: errorMsg } }
       );
@@ -214,15 +214,20 @@ export default {
         "/api/ecs_oe_student/examFaceLivenessVerify/getFaceLivenessVerifyToken/" +
           examRecordId
       );
-      if (!response.data || !response.data.token) {
-        this.updateFaceVerify("TOKEN_EXPIRED", null);
+
+      if (!response.data.success) {
+        console.log(response.data.errorMsg);
+        this.$Message.error({
+          content: "您上传的底照不适合做活体检测,请联系老师!",
+          duration: 15
+        });
         return;
       }
 
       this.showIframe = true;
       var iframe = document.getElementById("myFrame");
       try {
-        iframe.src = FACEID_LINENESS_URL + response.data.token;
+        iframe.src = FACEID_LINENESS_URL + response.data.faceLivenessToken;
       } catch (err) {
         console.error(err);
       }