From d9d6ce83f7651a664815cf02d91f4184146f9cbc Mon Sep 17 00:00:00 2001 From: claw_bot Date: Tue, 10 Mar 2026 06:50:55 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DIIFE=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=8C=E6=94=B9=E7=94=A8=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E5=86=99=E6=B3=95=E8=A7=A3=E6=9E=90=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/config/config.vue | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pages/config/config.vue b/pages/config/config.vue index e5091a0..013d7cd 100644 --- a/pages/config/config.vue +++ b/pages/config/config.vue @@ -192,26 +192,30 @@ const fetchStrategies = async () => { try { const response = await api.strategies.getStrategies(); if (response.code === 200) { - strategies.value = response.data.map(item => ({ - id: item.id, - name: item.name, - desc: item.description, - type: item.type, - parameters: item.config ? (() => { + strategies.value = response.data.map(item => { + let parameters = {}; + if (item.config) { try { let config = JSON.parse(item.config); // 如果解析后还是字符串,再解析一次(处理双层转义) if (typeof config === 'string') { config = JSON.parse(config); } - return config; + parameters = config; } catch (e) { console.error('解析策略配置失败:', e); - return {}; + parameters = {}; } - })(), - color: '#10B981' - })); + } + return { + id: item.id, + name: item.name, + desc: item.description, + type: item.type, + parameters: parameters, + color: '#10B981' + }; + }); } } catch (error) { console.error('获取策略列表失败:', error);