fix: 关闭 pdf 预览 (#5838)

pdfjs 安全漏洞,后续版本增加预览 pdf
pull/5844/head
4 months ago committed by GitHub
parent 464392f7e1
commit 3b1df05ae0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -30,7 +30,6 @@
"@highlightjs/vue-plugin": "^2.1.0", "@highlightjs/vue-plugin": "^2.1.0",
"@vue-office/docx": "^1.6.2", "@vue-office/docx": "^1.6.2",
"@vue-office/excel": "^1.7.8", "@vue-office/excel": "^1.7.8",
"@vue-office/pdf": "^2.0.2",
"@vueuse/core": "^8.9.4", "@vueuse/core": "^8.9.4",
"@xterm/addon-fit": "^0.10.0", "@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0", "@xterm/xterm": "^5.5.0",

@ -695,7 +695,7 @@ const openDeCompress = (item: File.File) => {
const openView = (item: File.File) => { const openView = (item: File.File) => {
const fileType = getFileType(item.extension); const fileType = getFileType(item.extension);
const previewTypes = ['image', 'video', 'audio', 'pdf', 'word', 'excel']; const previewTypes = ['image', 'video', 'audio', 'word', 'excel'];
if (previewTypes.includes(fileType)) { if (previewTypes.includes(fileType)) {
return openPreview(item, fileType); return openPreview(item, fileType);
} }

@ -35,15 +35,6 @@
<audio v-else-if="fileType === 'audio'" :src="fileUrl" controls></audio> <audio v-else-if="fileType === 'audio'" :src="fileUrl" controls></audio>
<vue-office-pdf
v-else-if="fileType === 'pdf'"
:src="fileUrl"
:style="isFullscreen ? 'height: 90vh' : 'height: 80vh'"
class="w-full"
@rendered="renderedHandler"
@error="errorHandler"
/>
<vue-office-docx <vue-office-docx
v-else-if="fileType === 'word'" v-else-if="fileType === 'word'"
:src="fileUrl" :src="fileUrl"
@ -73,7 +64,6 @@ import { ref } from 'vue';
import { Close, FullScreen } from '@element-plus/icons-vue'; import { Close, FullScreen } from '@element-plus/icons-vue';
import VueOfficeDocx from '@vue-office/docx'; import VueOfficeDocx from '@vue-office/docx';
import VueOfficeExcel from '@vue-office/excel'; import VueOfficeExcel from '@vue-office/excel';
import VueOfficePdf from '@vue-office/pdf';
import '@vue-office/docx/lib/index.css'; import '@vue-office/docx/lib/index.css';
import '@vue-office/excel/lib/index.css'; import '@vue-office/excel/lib/index.css';
import { MsgError } from '@/utils/message'; import { MsgError } from '@/utils/message';

Loading…
Cancel
Save