From 2bb8cb78e6754e3f095e52a09f2dd5882b31e938 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Tue, 11 Nov 2025 11:31:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A2=E6=9C=8D=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- craco.config.js | 7 +++++++ public/index.html | 2 +- .../config/bytedesk.config.js | 15 ++++----------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/craco.config.js b/craco.config.js index 9072329a..11aa6312 100644 --- a/craco.config.js +++ b/craco.config.js @@ -263,6 +263,13 @@ module.exports = { logLevel: 'debug', pathRewrite: { '^/concept-api': '' }, }, + '/bytedesk-api': { + target: 'http://43.143.189.195', + changeOrigin: true, + secure: false, + logLevel: 'debug', + pathRewrite: { '^/bytedesk-api': '' }, + }, }, }), }, diff --git a/public/index.html b/public/index.html index b6b22e07..926e855b 100755 --- a/public/index.html +++ b/public/index.html @@ -99,7 +99,7 @@ if (difyChatButton) { // 只在 /home 页面显示 if (currentPath === '/home') { - difyChatButton.style.display = 'flex'; + difyChatButton.style.display = 'none'; console.log('[Dify] 显示机器人(当前路径: /home)'); } else { difyChatButton.style.display = 'none'; diff --git a/src/bytedesk-integration/config/bytedesk.config.js b/src/bytedesk-integration/config/bytedesk.config.js index ff8e09a0..2f6b4f5e 100644 --- a/src/bytedesk-integration/config/bytedesk.config.js +++ b/src/bytedesk-integration/config/bytedesk.config.js @@ -21,6 +21,8 @@ export const bytedeskConfig = { apiUrl: BYTEDESK_API_URL, // 聊天页面地址 htmlUrl: `${BYTEDESK_API_URL}/chat/`, + // SDK 资源基础路径(用于加载内部模块 sdk.js, index.js 等) + baseUrl: 'https://www.weiyuai.cn', // 客服图标位置 placement: 'bottom-right', // bottom-right | bottom-left | top-right | top-left @@ -64,16 +66,7 @@ export const bytedeskConfig = { * @returns {Object} Bytedesk配置对象 */ export const getBytedeskConfig = () => { - // 开发环境使用代理(绕过 X-Frame-Options 限制) - if (process.env.NODE_ENV === 'development') { - return { - ...bytedeskConfig, - apiUrl: '/bytedesk-api', // 使用 CRACO 代理路径 - htmlUrl: '/bytedesk-api/chat/', // 使用 CRACO 代理路径 - }; - } - - // 生产环境使用完整 URL + // 所有环境都使用公网地址(不使用代理) return bytedeskConfig; }; @@ -120,7 +113,7 @@ export const getBytedeskConfigWithUser = (user) => { export const shouldShowCustomerService = (pathname) => { // 在以下页面隐藏客服(黑名单) const blockedPages = [ - '/home', // 登录页 + // '/home', // 登录页 ]; // 检查是否在黑名单