diff --git a/src/renderer/src/components/pdf/index.vue b/src/renderer/src/components/pdf/index.vue index 5c7cf13..1447c37 100644 --- a/src/renderer/src/components/pdf/index.vue +++ b/src/renderer/src/components/pdf/index.vue @@ -274,6 +274,7 @@ const initPdfone = async () => { } onMounted(async () => { try { + console.log(props.pdfObj.pdfUrl) // 创建canvas转化成图片 const pdf = await pdfjsLib.getDocument(props.pdfObj.pdfUrl).promise numPagesTotal.value = pdf.numPages diff --git a/src/renderer/src/views/classBegins/index.vue b/src/renderer/src/views/classBegins/index.vue index 6d4c402..5fc078a 100644 --- a/src/renderer/src/views/classBegins/index.vue +++ b/src/renderer/src/views/classBegins/index.vue @@ -50,7 +50,8 @@ const isOnLoadShow = ref(false) //加载完毕显示 // 传过去的参数 const pdfObj = reactive({ numberOfPdf: 2, //显示几页 - pdfUrl: getStaticUrl('aaa.pdf', 'user', 'selfFile', true), + // pdfUrl: getStaticUrl('aaa.pdf', 'user', 'selfFile', true),//本地 + pdfUrl: null, allPageData:[], bookId:null, numPages: 1 //当前页数 @@ -107,8 +108,7 @@ const switchPageMode = () => { } onMounted(async () => { toolState.isPdfWin=true - console.log(route.query.path,"c初始") - pdfObj.pdfUrl = route.query.path + pdfObj.pdfUrl = getStaticUrl(route.query.path, 'user', 'selfFile', true) textbookId.value = route.query.textbookId pdfObj.bookId=textbookId.value getBookMarkById(textbookId.value).then(res=>{ diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 6ba4d24..1385e10 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -538,7 +538,7 @@ export default { const toolStore = useToolState() if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作') let path = await this.getBookPathFromServer() - console.log(path) + path=path.replace(/^.*[\\\/]/, ''); // console.log(this.uploadData.textbookId) createWindow('open-PDF', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId+'&path='+ path }) },