From bd035a00d7f42dcf4e7ff3c2e4748380796079d8 Mon Sep 17 00:00:00 2001 From: RonnyChan96 Date: Sun, 27 Apr 2025 15:52:50 +0800 Subject: [PATCH] =?UTF-8?q?[elsa]=20=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E6=97=B6=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fit-elsa-react/src/components/base/jadeNode.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/framework/elsa/fit-elsa-react/src/components/base/jadeNode.jsx b/framework/elsa/fit-elsa-react/src/components/base/jadeNode.jsx index 43ad8fe4d..770feeb0a 100644 --- a/framework/elsa/fit-elsa-react/src/components/base/jadeNode.jsx +++ b/framework/elsa/fit-elsa-react/src/components/base/jadeNode.jsx @@ -117,9 +117,13 @@ export const jadeNode = (id, x, y, width, height, parent, drawer) => { // 开始节点只有输入,结束节点只有输出,普通节点输入输出,条件节点有条件1...n和输出 self.output = {}; self.input = {}; - if (data.parameters[0]) { - self.output = JSON.parse(data.parameters[0].output); - self.input = JSON.parse(data.parameters[0].input); + if (data?.parameters?.[0]) { + try { + self.output = JSON.parse(data.parameters[0]?.output ?? '{}'); + self.input = JSON.parse(data.parameters[0]?.input ?? '{}'); + } catch (e) { + console.error('JSON 解析失败:', e); + } } self.errorMsg = data.errorMsg; self.cost = data.runCost;