Merge pull request #208 from SuanmoSuanyangTechnology/feature/codeNode_zy
fix(web): remove URI decode and encode
This commit is contained in:
@@ -111,7 +111,7 @@ export const useWorkflowGraph = ({
|
|||||||
nodeLibraryConfig.config[key].defaultValue = Object.entries(config[key]).map(([name, value]) => ({ name, value }))
|
nodeLibraryConfig.config[key].defaultValue = Object.entries(config[key]).map(([name, value]) => ({ name, value }))
|
||||||
} else if (type === 'code' && key === 'code' && config[key] && nodeLibraryConfig.config && nodeLibraryConfig.config[key]) {
|
} else if (type === 'code' && key === 'code' && config[key] && nodeLibraryConfig.config && nodeLibraryConfig.config[key]) {
|
||||||
try {
|
try {
|
||||||
nodeLibraryConfig.config[key].defaultValue = decodeURIComponent(atob(config[key] as string))
|
nodeLibraryConfig.config[key].defaultValue = atob(config[key] as string)
|
||||||
} catch {
|
} catch {
|
||||||
nodeLibraryConfig.config[key].defaultValue = config[key]
|
nodeLibraryConfig.config[key].defaultValue = config[key]
|
||||||
}
|
}
|
||||||
@@ -851,7 +851,7 @@ export const useWorkflowGraph = ({
|
|||||||
const code = data.config[key].defaultValue || ''
|
const code = data.config[key].defaultValue || ''
|
||||||
itemConfig = {
|
itemConfig = {
|
||||||
...itemConfig,
|
...itemConfig,
|
||||||
code: btoa(encodeURIComponent(code || ''))
|
code: btoa(code || '')
|
||||||
}
|
}
|
||||||
} else if (key === 'memory' && data.config[key] && 'defaultValue' in data.config[key]) {
|
} else if (key === 'memory' && data.config[key] && 'defaultValue' in data.config[key]) {
|
||||||
const { messages, ...rest } = data.config[key].defaultValue
|
const { messages, ...rest } = data.config[key].defaultValue
|
||||||
|
|||||||
Reference in New Issue
Block a user