对接手机端

This commit is contained in:
范强强
2023-06-08 11:40:41 +08:00
parent 6c21adeb04
commit 94adfa0b1a
2 changed files with 34 additions and 19 deletions
+5 -3
View File
@@ -1,9 +1,11 @@
import { Base64 } from 'js-base64'
import { Toast } from 'vant'
window._CONFIG['domianPreviewURL'] = 'http://localhost:8082/jero-boot'
window._CONFIG['domianWebImgURL'] = 'http://localhost:8082/jero-boot'
let downLoadFileUrl = window._CONFIG['domianPreviewURL'] + '/sys/common/download'
let downLoadImgUrl = window._CONFIG['domianWebImgURL'] + '/sys/common/download'
export function kkFileView(fileName, fileId) {
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
@@ -11,11 +13,11 @@ export function kkFileView(fileName, fileId) {
window._CONFIG['onlinePreviewDomainURL'] = 'http://localhost:8012/onlinePreview'
if (fileSuffix == '.docx' || fileSuffix == '.doc' || fileSuffix == '.pdf' || fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(downLoadFileUrl + '/' + fileId + fileSuffix)
window.open(url, '_blank')
window.open(url)
} else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(downLoadImgUrl + '/' + fileId + fileSuffix)
window.open(url, '_blank')
}else {
window.open(url)
} else {
Toast('当前格式不支持预览')
}
}