Files
base/jero-web/src/utils/previewPdf.js
T

15 lines
393 B
Java

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
}