Michael Wang 6 жил өмнө
parent
commit
9128c9d0b7

+ 0 - 1
src/features/Login/Login.vue

@@ -94,7 +94,6 @@ export default {
       duration: 150,
       size: "large"
     });
-    this.$Message.info("test");
 
     try {
       const res = await this.$http.get(

+ 15 - 8
src/features/OnlineExam/Examing/FaceId.vue

@@ -100,6 +100,11 @@ export default {
         --this.timeCount;
         if (this.timeCount === 0) {
           clearInterval(timeCountInterval);
+          //   this.$Message.error({
+          //     content: "人脸检测超时,检测失败,系统退出,请重新登录",
+          //     duration: 30
+          //   });
+          //   this.logout();
         }
       }, 1000);
 
@@ -121,7 +126,8 @@ export default {
               that.faceTestEnd(receivedMsg);
             }
           })
-          .catch(() => {
+          .finally(() => {
+            // Chrome 63开始支持。但是vue-cli引入了p-finally,所以已经加在Promise对象中了
             clearInterval(timeCountInterval);
             this.logout();
           });
@@ -151,25 +157,25 @@ export default {
           if (receivedMsg.verifyResult == "TIME_OUT") {
             this.$Message.error({
               content: "第一次人脸检测超时,检测失败,系统退出,请重新登录",
-              duration: 15
+              duration: 30
             });
             this.logout();
           } else if (receivedMsg.verifyResult == "VERIFY_FAILED") {
             this.$Message.error({
               content: "第一次人脸检测失败,系统退出,请重新登录",
-              duration: 15
+              duration: 30
             });
             this.logout();
           } else if (receivedMsg.verifyResult == "NOT_ONESELF") {
             this.$Message.error({
               content: "人脸检测不合格,结束考试",
-              duration: 15
+              duration: 30
             });
             this.faceTestEndHandle("FAILED");
           } else if (receivedMsg.verifyResult == "VERIFY_SUCCESS") {
             this.$Message.info({
               content: "人脸检测成功,请继续完成考试",
-              duration: 15
+              duration: 30
             });
             this.faceTestEndHandle("SUCCESS");
           }
@@ -178,13 +184,13 @@ export default {
             // FIXME: 什么逻辑?
             this.$Message.info({
               content: "人脸检测成功,请继续完成考试",
-              duration: 15
+              duration: 30
             });
             this.faceTestEndHandle("SUCCESS");
           } else {
             this.$Message.error({
               content: "人脸检测不合格,结束考试",
-              duration: 15
+              duration: 30
             });
             this.faceTestEndHandle("FAILED");
           }
@@ -201,6 +207,7 @@ export default {
           var receivedMsg = JSON.parse(response.data);
           this.faceTestEnd(receivedMsg);
           clearTimeout(faceIdTime);
+          clearInterval(timeCountInterval);
           this.$emit("closeFaceId");
           ws.close();
         }
@@ -222,7 +229,7 @@ export default {
         console.log(response.data.errorMsg);
         this.$Message.error({
           content: "您上传的底照不适合做活体检测,请联系老师!",
-          duration: 15
+          duration: 30
         });
         return;
       }