From 8e5623d7233137c930a1e56431785fad8fc51f42 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Mon, 10 Nov 2025 19:58:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(customer-service):=20=E9=9B=86=E6=88=90=20?= =?UTF-8?q?Bytedesk=20=E5=AE=A2=E6=9C=8D=E7=B3=BB=E7=BB=9F=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20Dify=20=E6=9C=BA=E5=99=A8=E4=BA=BA?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 主要变更 ### 1. Dify 机器人优化 **文件**: public/index.html - ✅ 恢复 Dify 机器人代码 - ✅ 添加显示控制逻辑:只在 /home 页面显示 - ✅ 使用 JavaScript 监听路由变化,动态控制显示/隐藏 - ✅ 保留所有样式配置 ### 2. Bytedesk 客服系统集成 **文件**: src/bytedesk-integration/config/bytedesk.config.js - ✅ 配置开发环境使用代理路径(/bytedesk-api) - ✅ 修复 X-Frame-Options 跨域问题 - ✅ 优化 shouldShowCustomerService 逻辑:默认所有页面显示,只在 /login 隐藏 - ✅ 保留白名单模式代码作为备用方案 **文件**: src/components/GlobalComponents.js - ✅ 集成 BytedeskWidget 组件 - ✅ 使用 shouldShowCustomerService 控制显示 ### 3. 客服显示规则 **Dify 机器人**: - ✅ /home 页面 → 显示 - ❌ 其他页面 → 隐藏 **Bytedesk 客服**: - ✅ 所有页面 → 显示 - ❌ /login 页面 → 隐藏 ## 已知问题 - ⚠️ Bytedesk 服务器配置 enabled: false,需要后端修改为 true - ⚠️ 配置接口: /config/bytedesk/properties ## 测试建议 1. 访问 /home 页面,检查 Dify 机器人是否显示 2. 访问其他页面,检查 Dify 是否隐藏 3. 等待后端修改 enabled 后,测试 Bytedesk 客服功能 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- public/index.html | 43 ++++++++++++++++- .../config/bytedesk.config.js | 46 +++++++++---------- src/components/GlobalComponents.js | 17 +++++++ 3 files changed, 81 insertions(+), 25 deletions(-) diff --git a/public/index.html b/public/index.html index 03db34db..b6b22e07 100755 --- a/public/index.html +++ b/public/index.html @@ -65,6 +65,9 @@ To begin the development, run `npm start` or `yarn start`. To create a production bundle, use `npm run build` or `yarn build`. --> + + + + +