Files
laws_chery_client/src/utils/previewPdf.js
T
2024-06-11 15:39:01 +08:00

15 lines
386 B
JavaScript

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/view/${id}?type=view&at=${getToken()}`
return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf'
}
export {
previewPdf
}