[update] -文件预览去掉 base64 转码

This commit is contained in:
fengchenchen
2021-12-28 20:20:47 +08:00
parent 4afbaedb3c
commit d7f966b931
2 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -226,7 +226,8 @@
handlePreview(file) {
if (file && file.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
},
@@ -171,6 +171,7 @@ import Vue from 'vue'
import { ACCESS_TOKEN } from '../../store/mutation-types'
import PreviewFile from '../../components/jero/PreviewFile'
// eslint-disable-next-line no-undef,no-unused-vars
const Base64 = require('js-base64').Base64
export default {
@@ -487,8 +488,8 @@ export default {
console.log(file)
if (file && file.url) {
const fileFullUrl = `${ window._CONFIG['domianWebSocketURL'] }/sys/common/download/${ file.id }?token=${ Vue.ls.get(ACCESS_TOKEN) }&fullfilename=${ file.fileName }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(Base64.encode(fileFullUrl)) }`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
// let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(Base64.encode(fileFullUrl)) }`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
}
@@ -546,4 +547,4 @@ export default {
}
}
</style>
</style>