[update] pdf预览增加一个随机数参数
This commit is contained in:
@@ -5,7 +5,10 @@ const getToken = () => Vue.ls.get(ACCESS_TOKEN)
|
||||
|
||||
// 预览pdf
|
||||
const previewPdf = (id) => {
|
||||
const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&at=${getToken()}`
|
||||
const uidGenerator = () => {
|
||||
return '-' + parseInt(Math.random() * 10000 + 1, 10)
|
||||
}
|
||||
const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&at=${getToken()}&serial=${uidGenerator()}`
|
||||
return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user