提交 0ea6d8b6 编写于 作者: zhf's avatar zhf

fix: 修复预览路径不正确异常

上级 5bce3b28
...@@ -519,7 +519,7 @@ export default class DiskFileUpload extends Vue { ...@@ -519,7 +519,7 @@ export default class DiskFileUpload extends Vue {
let _this: any = this; let _this: any = this;
const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id); const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id);
const name = typeof item.name == "string" ? item.name : JSON.stringify(item.filename); const name = typeof item.name == "string" ? item.name : JSON.stringify(item.filename);
const downloadUrl = '/ibizutilrpm/download/' + this.getFolder() + '/' + id + '/' + name; const downloadUrl = '/ibizutilrpm/download/' + this.getFolder() + '/' + id + '/' + encodeURIComponent(name);
// 发送get请求 // 发送get请求
Axios.get(downloadUrl, { Axios.get(downloadUrl, {
headers: { headers: {
...@@ -577,10 +577,12 @@ export default class DiskFileUpload extends Vue { ...@@ -577,10 +577,12 @@ export default class DiskFileUpload extends Vue {
const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id); const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id);
const name = typeof item.name == "string" ? item.name : JSON.stringify(item.name); const name = typeof item.name == "string" ? item.name : JSON.stringify(item.name);
const downloadUrl = (window as any).Environment.ExportFile + '/' + id + '/' + name; //const downloadUrl = (window as any).Environment.ExportFile + '/' + id + '/' + encodeURIComponent(name);
const downloadUrl = Environment.BaseUrl + (window as any).Environment.ExportFile + '/' + id + '/' + name;
const previewFileUrl = Environment.previewFileUrl; const previewFileUrl = Environment.previewFileUrl;
if (previewFileUrl) { if (previewFileUrl) {
const url = encodeURIComponent(encode(`${window.location.origin}${downloadUrl}?fullfilename=${name}`)); const url = encodeURIComponent(encode(`${window.location.origin}${downloadUrl}`));
// const url = encodeURIComponent(encode(`${window.location.origin}${downloadUrl}?fullfilename=${name}`));
this.dialogTitle = name; this.dialogTitle = name;
this.showDialog = true; this.showDialog = true;
this.iframeUrl = `${previewFileUrl}/onlinePreview?url=${url}`; this.iframeUrl = `${previewFileUrl}/onlinePreview?url=${url}`;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册