Explorar o código

minor cleanup

Michael Wang %!s(int64=6) %!d(string=hai) anos
pai
achega
51bda5ee6e

+ 7 - 0
http-test/online-exam.http

@@ -77,4 +77,11 @@ key: {{key}}
 
 {"studentAnswer": "C"}
 
+### get upyun photo folder
+GET https://v0.api.upyun.com/exam-cloud/capture_photo/38156/
+Content-Type: application/json;charset=UTF-8
+Authorization: Basic ZXhhbWNsb3VkOmVjczg3ODYzNTc3IUAj
+x-list-order: desc
+
+
 

+ 26 - 3
src/components/FaceRecognition/FaceRecognition.vue

@@ -1,9 +1,22 @@
 <template>
   <div>
-    <video id="video" ref="video" :width="width" :height="height" autoplay>
+    <video
+      id="video"
+      ref="video"
+      :width="width"
+      :height="height"
+      autoplay
+    >
     </video>
-    <div v-if="showRecognizeButton" style="position: absolute; width: 400px; text-align: center; margin-top: -50px; color: #232323;">
-      <button class="verify-button" @click="snap" :disabled="disableSnap">{{msg}}</button>
+    <div
+      v-if="showRecognizeButton"
+      style="position: absolute; width: 400px; text-align: center; margin-top: -50px; color: #232323;"
+    >
+      <button
+        class="verify-button"
+        @click="snap"
+        :disabled="disableSnap"
+      >{{msg}}</button>
     </div>
   </div>
 </template>
@@ -79,6 +92,7 @@ export default {
       try {
         const examRecordDataId = this.$route.params.examRecordDataId;
         const captureBlob = await this.getSnapShot();
+        // console.log(captureBlob.size);
         const [fileName, captureFilePath] = await this.uploadToServer(
           captureBlob
         );
@@ -107,6 +121,15 @@ export default {
 
       try {
         this.disableSnap = true;
+        // console.log("disableSnap: " + this.disableSnap);
+        // await new Promise(resolve =>
+        //   setTimeout(() => {
+        //     console.log(new Date());
+        //     resolve();
+        //   }, 3000)
+        // );
+        // return;
+        // if(this.disableSnap) return; // 避免界面没有更新。
         this.msg = "拍照中...";
         const captureBlob = await this.getSnapShot();
         this.msg = "上传照片中...";

+ 0 - 13
src/features/OnlineExam/OnlineExamList.vue

@@ -187,19 +187,6 @@ export default {
     // eslint-disable-next-line
     async faceCheckResultCallback(course, faceMatched) {
       // if faceMatched
-    },
-    previewPaper(course) {
-      var user = {
-        loginName: course.examStudentId,
-        backUrl: window.document.location.href,
-        isOnlineExam: true
-      };
-      window.name = JSON.stringify(user);
-      window.location.href =
-        this.tk_server_url +
-        "/#/preview_paper/" +
-        course.paperId +
-        "?isback=true";
     }
   },
   computed: {