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', // 登录页 ]; // 检查是否在黑名单