Explorar el Código

Merge remote-tracking branch 'origin/master'

WANG hace 6 años
padre
commit
94db0b2d94
Se han modificado 2 ficheros con 38 adiciones y 21 borrados
  1. 7 7
      src/modules/oe/views/captureDetail.vue
  2. 31 14
      src/modules/oe/views/examScheduling.vue

+ 7 - 7
src/modules/oe/views/captureDetail.vue

@@ -188,13 +188,13 @@ export default {
         });
     },
     getStudentInfo(studentId) {
-      this.$http.get("/api/ecs_core/student/" + studentId).then(response => {
-        if (response.data.photoPath) {
-          var prefix =
-            "http://exam-cloud-test.b0.upaiyun.com/student_base_photo/";
-          this.studentBasePhotoPath = prefix + response.data.photoPath;
-        }
-      });
+      this.$http
+        .get("/api/ecs_core/student/getStudentInfo?studentId=" + studentId)
+        .then(response => {
+          if (response.data.photoPath) {
+            this.studentBasePhotoPath = response.data.photoPath;
+          }
+        });
     },
     /**
      * 审核通过

+ 31 - 14
src/modules/oe/views/examScheduling.vue

@@ -366,20 +366,37 @@ export default {
             if (examRecordList && examRecordList.length > 0) {
               var basePaperId = examRecordList[0].basePaperId;
               var rootOrgName = currentUser.rootOrgName;
-              var token = currentUser.token;
-              var key = currentUser.key;
-              window.location.href =
-                "http://192.168.10.39:8868" +
-                "/api/ecs_ques/paper/export/" +
-                basePaperId +
-                "/PAPER/" +
-                rootOrgName +
-                "/" +
-                basePaperId +
-                "/offLine?$key=" +
-                key +
-                "&$token=" +
-                token;
+              this.$http
+                .get(
+                  "/api/ecs_ques/paper/export/" +
+                    basePaperId +
+                    "/PAPER/" +
+                    rootOrgName +
+                    "/" +
+                    basePaperId +
+                    "/offLine",
+                  {
+                    responseType: "arraybuffer",
+                    filename: "utf-8"
+                  }
+                )
+                .then(response => {
+                  if (response.data) {
+                    var blob = new Blob([response.data], {
+                      type: "application/zip"
+                    });
+                    var url = URL.createObjectURL(blob);
+                    var fileName = response.headers["content-disposition"]
+                      .split(";")[1]
+                      .replace("filename=", "");
+                    var a = document.createElement("a");
+                    a.href = url;
+                    a.download = decodeURI(fileName);
+                    a.target = "_blank";
+                    a.click();
+                    URL.revokeObjectURL(url);
+                  }
+                });
             } else {
               this.$message({
                 message: "该考生未参加考试",