fix: 前端文件预览跳转

(cherry picked from commit 18f43251d56f7018b3b38493c5eaf59451faf9b0)
This commit is contained in:
2024-09-09 16:50:30 +08:00
parent 3ddf8c3a58
commit b7e437142a
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ import Vue from 'vue'
import { ACCESS_TOKEN } from '../store/mutation-types'
import { getFileAccessHttpUrl } from '../api/manage'
import { previewPdf } from '../utils/previewPdf'
import {dealUrl} from "@/utils/kkFilePreview";
const Base64 = require('js-base64').Base64
@@ -101,7 +102,7 @@ export default {
return
}
// 其余可预览文件仍使用KKFile进行预览
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
const url = dealUrl(fileFullUrl)
window.open(url)
}
}
@@ -180,6 +180,7 @@ import OnlyOnlineEditBaseInfo from '@/views/workCenter/enterpriseStandardRevisio
import ZUpload from '@/components/ZUpload'
import { Base64 } from 'js-base64'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import {dealUrl} from "@/utils/kkFilePreview";
export default {
name: 'EnterpriseStandardRevision',
@@ -528,7 +529,7 @@ export default {
const file = res.result
const filePaths = file.editFilePath.split('/')
const fileName = filePaths[filePaths.length - 1]
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(this.documentUrl + file.editFilePath + '&fullfilename=' + fileName))}`
const url = dealUrl(this.documentUrl + file.editFilePath + '&fullfilename=' + fileName)
console.log(this.documentUrl + file.editFilePath + '&fullfilename=' + fileName)
window.open(url, '_blank')
}