[update] 预览接口加时间戳做标识

This commit is contained in:
lideqin
2024-08-07 13:34:51 +08:00
parent 592e138e64
commit 485de00252
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -28,6 +28,9 @@ export function dealUrl (fileUrl) {
const watermarkTxt = `${userInfo.username} ${userInfo.realname} ${time}`
// 客户环境预览需要加的加密参数
const watermarkSign = md5(watermarkTxt + 'cnhtc')
// 路径增加时间戳
const timestamp = new Date().getTime()
fileUrl += `&time=${timestamp}`
return `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileUrl))}&watermarkTxt=${encodeURIComponent(watermarkTxt)}&watermarkSign=${watermarkSign}`
}
+2 -1
View File
@@ -5,7 +5,8 @@ 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 timestamp = new Date().getTime()
const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&at=${getToken()}&time=${timestamp}`
return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf'
}