diff --git a/craco.config.js b/craco.config.js index 11aa6312..9006f93e 100644 --- a/craco.config.js +++ b/craco.config.js @@ -264,11 +264,26 @@ module.exports = { pathRewrite: { '^/concept-api': '' }, }, '/bytedesk-api': { - target: 'http://43.143.189.195', + target: 'https://valuefrontier.cn', // 统一使用生产环境 Nginx 代理 changeOrigin: true, - secure: false, + secure: false, // 开发环境禁用 HTTPS 严格验证 logLevel: 'debug', - pathRewrite: { '^/bytedesk-api': '' }, + ws: true, // 支持 WebSocket + // 不使用 pathRewrite,保留 /bytedesk-api 前缀,让生产 Nginx 处理 + }, + '/chat': { + target: 'https://valuefrontier.cn/bytedesk-api', // Bytedesk iframe 内部的资源(SDK、CSS等) + changeOrigin: true, + secure: false, // 开发环境禁用 HTTPS 严格验证 + logLevel: 'debug', + // 保留 /chat 路径 + }, + '/config': { + target: 'https://valuefrontier.cn/bytedesk-api', // Bytedesk 配置接口 + changeOrigin: true, + secure: false, // 开发环境禁用 HTTPS 严格验证 + logLevel: 'debug', + // 保留 /config 路径 }, }, }),