fix(web): Compatible with Windows whitespace

This commit is contained in:
zhaoying
2026-04-14 17:43:58 +08:00
parent 3c2a78a449
commit 47c242e513
2 changed files with 12 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-09 18:35:43
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-04-02 17:17:06
* @Last Modified time: 2026-04-14 17:36:53
*/
import { type FC, useMemo, useRef, useState } from "react";
import { useTranslation } from 'react-i18next'
@@ -35,9 +35,8 @@ const HttpRequest: FC<{ options: Suggestion[]; selectedNode?: any; graphRef?: an
form.setFieldsValue({ auth })
}
const handleChangeBodyContentType = (e: any) => {
const value = e.target.value || e.target.value
form.setFieldValue(['body', 'data'], ['form-data', 'x-www-form-urlencoded'].includes(value) ? [{}] : undefined)
const handleChangeBodyContentType = () => {
form.setFieldValue(['body', 'data'], undefined)
}
// Handle error handling method change and update node ports accordingly

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 15:17:48
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-04-14 15:05:33
* @Last Modified time: 2026-04-14 17:43:14
*/
import { Clipboard, Graph, Keyboard, MiniMap, Node, Snapline, type Edge } from '@antv/x6';
import { register } from '@antv/x6-react-shape';
@@ -1200,9 +1200,6 @@ export const useWorkflowGraph = ({
}) || [];
const edges = graphRef.current?.getEdges() || []
console.log('config', config)
const params = {
...config,
features: featuresRef.current,
@@ -1262,6 +1259,14 @@ export const useWorkflowGraph = ({
itemConfig[key][vo.key] = vo.value
})
}
} else if (data.type === 'http-request' && key === 'body' && data.config[key] && 'defaultValue' in data.config[key]) {
const value = data.config[key].defaultValue
itemConfig[key] = value
if (value.content_type === 'json' && value.data && value.data !== '') {
itemConfig[key].data = value.data.replace(/\u00a0/g, ' ')
} else {
itemConfig[key].data = value.data
}
} else if (data.config[key] && 'defaultValue' in data.config[key] && key !== 'knowledge_retrieval') {
itemConfig[key] = data.config[key].defaultValue
} else if (key === 'knowledge_retrieval' && data.config[key] && 'defaultValue' in data.config[key]) {