pages/fileView/pdfView.vue
@@ -17,8 +17,14 @@ }, onLoad(option) { let fileUrl = decodeURIComponent(option.url) this.allUrl = this.viewerUrl + '?file=' + fileUrl//将插件地址与接收的文件地址拼接起来 // let fileUrl = decodeURIComponent(option.url) // this.allUrl = this.viewerUrl + '?file=' + fileUrl//将插件地址与接收的文件地址拼接起来 const base64Data = getApp().globalData.tempPDF; this.pdfUrl = `data:application/pdf;base64,${base64Data}`; this.allUrl = this.viewerUrl + '?file=' + encodeURIComponent(this.pdfUrl) } } </script>