From bd716417e802b6343f499cbadf7aee31f5734e0c Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Tue, 11 Feb 2025 11:30:10 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/7738=E3=80=91=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E5=B8=A6"success"=E5=AF=BC=E5=87=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecgboot-vue3/src/hooks/system/useMethods.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/jeecgboot-vue3/src/hooks/system/useMethods.ts b/jeecgboot-vue3/src/hooks/system/useMethods.ts index 0259067b..d10879a4 100644 --- a/jeecgboot-vue3/src/hooks/system/useMethods.ts +++ b/jeecgboot-vue3/src/hooks/system/useMethods.ts @@ -34,13 +34,19 @@ export function useMethods() { reader.onload = async () => { if(reader.result){ if(reader.result.toString().indexOf("success") !=-1){ - const { success, message } = JSON.parse(reader.result.toString()); - if (!success) { - createMessage.warning("导出失败,失败原因:"+ message); - }else{ + // update-begin---author:liaozhiyang---date:2025-02-11---for:【issues/7738】文件中带"success"导出报错 --- + try { + const { success, message } = JSON.parse(reader.result.toString()); + if (!success) { + createMessage.warning('导出失败,失败原因:' + message); + } else { + exportExcel(name, isXlsx, data); + } + return; + } catch (error) { exportExcel(name, isXlsx, data); } - return; + // update-end---author:liaozhiyang---date:2025-02-11---for:【issues/7738】文件中带"success"导出报错 --- } } exportExcel(name, isXlsx, data);