From 165fe077bc1c5d08999f7acd9f3e8df119d46ad2 Mon Sep 17 00:00:00 2001 From: heheer Date: Fri, 25 Oct 2024 11:53:32 +0800 Subject: [PATCH] fix: http raw response undefined (#2981) --- .../service/core/workflow/dispatch/tools/http468.ts | 13 +++++++++---- .../detail/components/WorkflowComponents/utils.tsx | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/service/core/workflow/dispatch/tools/http468.ts b/packages/service/core/workflow/dispatch/tools/http468.ts index 90505930c..fb2f58c97 100644 --- a/packages/service/core/workflow/dispatch/tools/http468.ts +++ b/packages/service/core/workflow/dispatch/tools/http468.ts @@ -232,10 +232,15 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise = {}; - node.outputs.forEach((item) => { - const key = item.key.startsWith('$') ? item.key : `$.${item.key}`; - results[item.key] = JSONPath({ path: key, json: formatResponse })[0]; - }); + node.outputs + .filter( + (item) => + item.key !== NodeOutputKeyEnum.error && item.key !== NodeOutputKeyEnum.httpRawResponse + ) + .forEach((item) => { + const key = item.key.startsWith('$') ? item.key : `$.${item.key}`; + results[item.key] = JSONPath({ path: key, json: formatResponse })[0]; + }); if (typeof formatResponse[NodeOutputKeyEnum.answerText] === 'string') { workflowStreamResponse?.({ diff --git a/projects/app/src/pages/app/detail/components/WorkflowComponents/utils.tsx b/projects/app/src/pages/app/detail/components/WorkflowComponents/utils.tsx index 78adddbd9..7acfac8cc 100644 --- a/projects/app/src/pages/app/detail/components/WorkflowComponents/utils.tsx +++ b/projects/app/src/pages/app/detail/components/WorkflowComponents/utils.tsx @@ -1,6 +1,6 @@ import { computedNodeInputReference } from '@/web/core/workflow/utils'; import { AppDetailType } from '@fastgpt/global/core/app/type'; -import { NodeInputKeyEnum } from '@fastgpt/global/core/workflow/constants'; +import { NodeInputKeyEnum, NodeOutputKeyEnum } from '@fastgpt/global/core/workflow/constants'; import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant'; import { StoreEdgeItemType } from '@fastgpt/global/core/workflow/type/edge'; import { FlowNodeItemType, StoreNodeItemType } from '@fastgpt/global/core/workflow/type/node.d'; @@ -125,7 +125,7 @@ export const getEditorVariables = ({ : sourceNodes .map((node) => { return node.outputs - .filter((output) => !!output.label) + .filter((output) => !!output.label && output.id !== NodeOutputKeyEnum.addOutputParam) .map((output) => { return { label: t((output.label as any) || ''),