fix: 前端文件预览跳转
(cherry picked from commit 18f43251d56f7018b3b38493c5eaf59451faf9b0)
This commit is contained in:
@@ -18,6 +18,7 @@ import Vue from 'vue'
|
|||||||
import { ACCESS_TOKEN } from '../store/mutation-types'
|
import { ACCESS_TOKEN } from '../store/mutation-types'
|
||||||
import { getFileAccessHttpUrl } from '../api/manage'
|
import { getFileAccessHttpUrl } from '../api/manage'
|
||||||
import { previewPdf } from '../utils/previewPdf'
|
import { previewPdf } from '../utils/previewPdf'
|
||||||
|
import {dealUrl} from "@/utils/kkFilePreview";
|
||||||
|
|
||||||
const Base64 = require('js-base64').Base64
|
const Base64 = require('js-base64').Base64
|
||||||
|
|
||||||
@@ -101,7 +102,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 其余可预览文件仍使用KKFile进行预览
|
// 其余可预览文件仍使用KKFile进行预览
|
||||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
const url = dealUrl(fileFullUrl)
|
||||||
window.open(url)
|
window.open(url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ import OnlyOnlineEditBaseInfo from '@/views/workCenter/enterpriseStandardRevisio
|
|||||||
import ZUpload from '@/components/ZUpload'
|
import ZUpload from '@/components/ZUpload'
|
||||||
import { Base64 } from 'js-base64'
|
import { Base64 } from 'js-base64'
|
||||||
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||||||
|
import {dealUrl} from "@/utils/kkFilePreview";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EnterpriseStandardRevision',
|
name: 'EnterpriseStandardRevision',
|
||||||
@@ -528,7 +529,7 @@ export default {
|
|||||||
const file = res.result
|
const file = res.result
|
||||||
const filePaths = file.editFilePath.split('/')
|
const filePaths = file.editFilePath.split('/')
|
||||||
const fileName = filePaths[filePaths.length - 1]
|
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)
|
console.log(this.documentUrl + file.editFilePath + '&fullfilename=' + fileName)
|
||||||
window.open(url, '_blank')
|
window.open(url, '_blank')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user