【fix bug】66408 文件上传组件JUpload预览问题

This commit is contained in:
dujie
2023-04-12 11:41:01 +08:00
parent 6de4cf368f
commit 6be636f3c0
2 changed files with 42 additions and 12 deletions
+14
View File
@@ -0,0 +1,14 @@
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
const getToken = () => Vue.ls.get(ACCESS_TOKEN)
// 预览pdf
const previewPdf = (id) => {
const url = `${window._CONFIG.domianURL}/sys/common/download/${id}?type=view&token=${getToken()}`
return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf'
}
export {
previewPdf
}