feat: 客服通知代码提交

This commit is contained in:
zdl
2025-11-11 11:31:40 +08:00
parent 8e5623d723
commit 2bb8cb78e6
3 changed files with 12 additions and 12 deletions

View File

@@ -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': '' },
},
},
}),
},

View File

@@ -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';

View File

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