diff --git a/src/utils/kkFilePreview.js b/src/utils/kkFilePreview.js index 38eec74b..ff76aff7 100644 --- a/src/utils/kkFilePreview.js +++ b/src/utils/kkFilePreview.js @@ -28,6 +28,10 @@ export function dealUrl (fileUrl) { const watermarkTxt = `${userInfo.username} ${userInfo.realname} ${time}` // 客户环境预览需要加的加密参数 const watermarkSign = md5(watermarkTxt + 'cnhtc') + const uidGenerator = () => { + return '-' + parseInt(Math.random() * 10000 + 1, 10) + } + fileUrl += `&serial=${uidGenerator()}` return `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileUrl))}&watermarkTxt=${encodeURIComponent(watermarkTxt)}&watermarkSign=${watermarkSign}` }