From 70a96925b73445963655f25ae6ff2deb4c4e53e4 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Sat, 23 Mar 2024 10:33:33 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-116621=20=20fix:=20=E3=80=90=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=8B=86=E5=88=86=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=B6=88=E6=81=AF=E7=BB=93=E6=9E=84=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/decision.api.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index e62e14a..b967a0a 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -66,9 +66,11 @@ export class DecisionApi implements Api { return new Promise((resolve, rejected) => { this.addEventListener(editStatusEvent.OPEN, res => { - if (res.errorCode) { + const data = JSON.parse(res.data); + + if (data.errorCode) { let errorMessage = ''; - switch (res.errorCode) { + switch (data.errorCode) { case errorCode.CONNECTION_DELETED: errorMessage = 'Dec-Dcm_Connection_Deleted'; break; @@ -76,13 +78,13 @@ export class DecisionApi implements Api { errorMessage = 'Dec-Dcm_Connection_Is_Using'; break; default: - errorMessage = res.errorMsg; + errorMessage = data.errorMessage; break; } - BI.Msg.toast(BI.i18nText(errorMessage, res.errorMsg), { + BI.Msg.toast(BI.i18nText(errorMessage, data.errorMessage), { level: 'error', }); - rejected(res); + rejected(data); } else { resolve(res); }