natasha %!s(int64=3) %!d(string=hai) anos
pai
achega
b5db6d0c72

+ 1 - 1
src/views/TextbookDetail.vue

@@ -562,7 +562,7 @@ export default {
     },
     // 跳转预览PDF
     handleJumpPdf(index){
-        this.$router.push("/TextbookDetailPdf?id=" + this.TextBookId+'&url='+Base64.encodeURL(this.fileListDoc[index].file_url)+'&invok_module='+this.$route.query.invok_module+'&fileId='+Base64.encodeURL(this.fileListDoc[index].file_id));
+        this.$router.push("/TextbookDetailPdf?id=" + this.TextBookId+'&url='+Base64.encodeURL(this.fileListDoc[index].file_url)+'&invok_module='+this.$route.query.invok_module+'&fileId='+Base64.encodeURL(this.fileListDoc[index].file_id)+'&relativePath='+Base64.encodeURL(this.fileListDoc[index].file_relative_path));
     },
     // 跳转预览视频
     handleJumpVideo(index){

+ 4 - 16
src/views/textbook-detail/TextbookDetailPdf.vue

@@ -61,7 +61,6 @@ import { Base64 } from 'js-base64';
 import {
   TextbookAPI,
   LearnWebSI,
-  getContentFile,
 } from "@/api/ajax";
 export default {
   name: "TextbookDetailPdf",
@@ -188,25 +187,15 @@ export default {
         .then((res) => {
           this.data = res;
           this.loading = false;
+          this.attachment =
+                    process.env.VUE_APP_PDF_API + Base64.decode(this.$route.query.relativePath)
+          this.getNumPages();
+          console.log(this.attachment)
         })
         .catch((res) => {
           this.loading = false;
         });
     },
-    // 获取文件信息
-    getFileDetail(){
-        let MethodName = "file_store_manager-GetFileStoreInfo";
-        getContentFile(MethodName, {
-          file_id: Base64.decode(this.$route.query.fileId),
-        }).then((res) => {
-            if(res.status==1){
-                this.attachment =
-                    process.env.VUE_APP_PDF_API + res.file_relative_path
-                this.getNumPages();
-                console.log(this.attachment)
-            }
-        });
-    },
   },
   async created() {
     await updateWordPack({
@@ -244,7 +233,6 @@ export default {
     this.materialId = this.$route.query.id;
       if (this.materialId) {
         this.getdetail();
-        this.getFileDetail()
       }
   },
 };