fix: 处理策略config双层转义问题,前端自动解析两层JSON

This commit is contained in:
claw_bot 2026-03-10 06:34:34 +00:00
parent d873651c16
commit 8c16358c56

View File

@ -197,7 +197,19 @@ const fetchStrategies = async () => {
name: item.name,
desc: item.description,
type: item.type,
parameters: item.config ? JSON.parse(item.config) : {},
parameters: item.config ? (() => {
try {
let config = JSON.parse(item.config);
//
if (typeof config === 'string') {
config = JSON.parse(config);
}
return config;
} catch (e) {
console.error('解析策略配置失败:', e);
return {};
}
})(),
color: '#10B981'
}));
}