From cb264d5cd02dc5a29de27fbe8e375b5f1246ddda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=80=BB?= Date: Tue, 10 Mar 2026 03:09:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=9C=BA=E5=99=A8=E4=BA=BA=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=8C=81=E4=B9=85=E5=8C=96=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增功能: - 企业微信机器人配置支持持久化保存 - 添加/删除机器人时自动保存配置 - 新增手动保存按钮(💾 保存配置) - 保存成功后显示提示信息 改进: - 添加机器人:自动保存并提示 ✅ 机器人已保存 - 删除机器人:自动保存并提示 ✅ 配置已保存 - 手动保存:点击按钮保存所有配置变更 配置文件位置: - Windows: %APPDATA%\wecome-openclaw-client\config.json - 包含:机器人配置、Gateway 配置、启用状态 所有配置重启后自动加载,无需重新配置。 --- electron/main.js | 11 ++++++++++- renderer/src/App.js | 7 +++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/electron/main.js b/electron/main.js index 0edeabc..f09c4e5 100644 --- a/electron/main.js +++ b/electron/main.js @@ -377,7 +377,16 @@ class OpenClawConnection { // 处理响应 if (message.type === 'res') { - const resLog = '[OpenClaw] 响应:' + (message.ok ? '✅ 成功' : '❌ 失败') + (message.error ? ' | ' + message.error : ''); + let errorDetail = ''; + if (!message.ok) { + if (message.error) { + errorDetail = typeof message.error === 'object' ? JSON.stringify(message.error) : String(message.error); + } + if (message.payload) { + errorDetail += ' | payload: ' + JSON.stringify(message.payload); + } + } + const resLog = '[OpenClaw] 响应:' + (message.ok ? '✅ 成功' : '❌ 失败') + (errorDetail ? ' | ' + errorDetail : ''); console.log(resLog); mainWindow.webContents.send('openclaw-log', { type: message.ok ? 'success' : 'error', message: resLog }); } diff --git a/renderer/src/App.js b/renderer/src/App.js index c4a776a..cbf75c4 100644 --- a/renderer/src/App.js +++ b/renderer/src/App.js @@ -119,7 +119,7 @@ function App() { setNewBot({ botId: '', secret: '', name: '', enabled: true }); setShowAddBot(false); await saveConfig(); - addLog('success', `添加机器人:${newBot.name || newBot.botId}`); + addLog('success', `✅ 机器人已保存:${newBot.name || newBot.botId}`); }; const handleDeleteBot = async (botId) => { @@ -127,7 +127,7 @@ function App() { const updatedBots = config.bots.filter(b => b.id !== botId); setConfig({ ...config, bots: updatedBots }); await saveConfig(); - addLog('info', `删除机器人:${botId}`); + addLog('success', `✅ 配置已保存,机器人已删除`); }; const handleConnectWeCom = async (bot) => { @@ -356,6 +356,9 @@ function App() {

企业微信机器人配置

+