提交 7286fa58 authored 作者: 王鹏飞's avatar 王鹏飞

fix: 修复报名附件预览不了的问题

上级 da5014a3
...@@ -389,18 +389,19 @@ export default { ...@@ -389,18 +389,19 @@ export default {
this.$message({ type: 'warning', message: '无法查看' }) this.$message({ type: 'warning', message: '无法查看' })
return return
} }
url = url.includes('?') ? url.split('?').shift() : url url = url.replace(/^http:\/\//, 'https://')
const tempUrl = url.includes('?') ? url.split('?').shift() : url
const names = ['jpg', 'jpeg', 'png', 'gif'] const names = ['jpg', 'jpeg', 'png', 'gif']
const name = url.split('.').pop() || '' const name = tempUrl.split('.').pop() || ''
if (names.includes(name.toLocaleLowerCase())) { if (names.includes(name.toLocaleLowerCase())) {
this.previewImageUrl = file.oss_sign_url this.previewImageUrl = url
this.previewImageTitle = file.file_type_label this.previewImageTitle = file.file_type_label
this.$nextTick(() => { this.$nextTick(() => {
this.viewer.update() this.viewer.update()
this.viewer.show(true) this.viewer.show(true)
}) })
} else { } else {
this.newWindowPreview(file.oss_sign_url) this.newWindowPreview(url)
} }
}, },
// 新窗口预览 // 新窗口预览
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论