From a6379e86cced738f035945ed84b3715df5a384f0 Mon Sep 17 00:00:00 2001 From: ShineKOT <1917095344@qq.com> Date: Wed, 27 Mar 2024 14:00:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=20=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=85=A5=E9=94=99=E8=AF=AF=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ .../async-action-preview/async-action-preview.tsx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55b7473e0..e05f83e15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ 并且此项目遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/). ## [Unreleased] +### Fixed +- 修复下载数据导入错误文件异常 ## [0.6.13] - 2024-03-26 ### Added diff --git a/src/panel-component/user-message/async-action/async-action-preview/async-action-preview.tsx b/src/panel-component/user-message/async-action/async-action-preview/async-action-preview.tsx index 46501560d..5bed4b340 100644 --- a/src/panel-component/user-message/async-action/async-action-preview/async-action-preview.tsx +++ b/src/panel-component/user-message/async-action/async-action-preview/async-action-preview.tsx @@ -30,7 +30,12 @@ function fileDownload(file: { url: string; name: string }): void { delimiter: ';', }).filename as string; if (filename) { - file.name += `.${filename.split('.')[1]}`; + // 特殊处理返回的文件名带有双引号 + file.name += `.${ + filename.startsWith('"') && filename.endsWith('"') + ? filename.substring(1, filename.length - 1).split('.')[1] + : filename.split('.')[1] + }`; } if (response.status !== 200) { @@ -110,6 +115,7 @@ export const AsyncActionPreview = defineComponent({ // 错误文件 if (actionResult.errorfile) { info.errorFileUrl = `${ibiz.env.baseUrl}/${ibiz.env.appId}${ibiz.env.downloadFileUrl}/${actionResult.errorfile.folder}/${actionResult.errorfile.fileid}`; + info.errorFileUrl = info.errorFileUrl.replace('/{cat}', ''); } } -- Gitee