diff --git a/App.vue b/App.vue index 09f2e4e..e638aa6 100644 --- a/App.vue +++ b/App.vue @@ -266,7 +266,6 @@ imgUrl: this.$util.img(share_data.imgUrl) }, res => { - console.log(res); } ); } diff --git a/common/js/ai-service.js b/common/js/ai-service.js index a1ae59f..9bda135 100644 --- a/common/js/ai-service.js +++ b/common/js/ai-service.js @@ -40,15 +40,6 @@ export default { */ async sendMessage(message, options = {}) { try { - // 调试:打印关键状态 - console.log('[AI Service] sendMessage 开始执行'); - console.log('[AI Service] store.state.memberInfo:', store.state.memberInfo); - console.log('[AI Service] uniacid:', this.getUniacid()); - console.log('[AI Service] currentConversationId:', this.getConversationId()); - - const aiConfig = store.getters.globalAIKefuConfig; - console.log('[AI Service] aiConfig:', aiConfig); - const params = { url: '/api/kefu/chat', data: { @@ -66,16 +57,11 @@ export default { } }; - console.log('[AI Service] 发送请求到:', params.url); - console.log('[AI Service] 请求参数:', JSON.stringify(params.data, null, 2)); - const response = await http.sendRequest({ ...params, async: false }); - console.log('[AI Service] 收到响应:', response); - const result = this.handleResponse(response); if (result.conversationId) { this.setConversationId(result.conversationId); @@ -103,7 +89,6 @@ export default { const match = Config.baseUrl.match(/^(?:https?:\/\/|wss?:\/\/)([^\/\s:]+)/); const domain = match ? match[1] : ''; const wssUrl = `wss://${domain}/ws/aikefu`; - console.log(`wssUrl = ${wssUrl}`); const socketTask = wx.connectSocket({ url: wssUrl, header: {} @@ -114,7 +99,6 @@ export default { let isAuthenticated = false; socketTask.onOpen(() => { - console.log('WebSocket 连接成功,开始认证...'); socketTask.send({ data: JSON.stringify({ action: 'auth', @@ -128,10 +112,8 @@ export default { socketTask.onMessage((res) => { try { const data = JSON.parse(res.data); - console.log('收到 WebSocket 消息:', data); if (data.type === 'auth_success') { - console.log('认证成功,发送聊天消息...'); isAuthenticated = true; socketTask.send({ data: JSON.stringify({ @@ -173,7 +155,6 @@ export default { // 可选:处理 done else if (data.type === 'done') { - console.log('对话完成:', data); } } catch (e) { @@ -189,7 +170,6 @@ export default { }); socketTask.onClose(() => { - console.log('WebSocket 连接已关闭'); }); const timeout = setTimeout(() => { @@ -388,7 +368,6 @@ export default { async: false, data: {} }); - console.log('/api/kefu/health response', response); const available = [response?.data?.status, response?.data?.components?.ai_service_config?.status] .filter(item => item === 'healthy').length > 0; return { diff --git a/common/js/config.js b/common/js/config.js index ec8d65b..06779c6 100644 --- a/common/js/config.js +++ b/common/js/config.js @@ -59,7 +59,6 @@ if (process?.env?.NODE_ENV === 'development') { // 如果本地配置文件不存在或加载失败,保持使用默认配置 // 只在开发模式下输出提示信息 // #ifdef WEB - console.log('本地配置文件 .local.config.js 不存在,使用默认配置'); // #endif } } diff --git a/common/js/customer-service.js b/common/js/customer-service.js index 78d472e..288770f 100644 --- a/common/js/customer-service.js +++ b/common/js/customer-service.js @@ -32,7 +32,6 @@ export class CustomerService { // 优先级:外部传入 > vuex store > 空对象 const servicerConfig = this.externalConfig || this.vm.$store.state.servicerConfig || {}; - console.log(`【实时客服配置】`, servicerConfig); let platformConfig = null; @@ -167,8 +166,6 @@ export class CustomerService { } const config = this.getPlatformConfig(); - console.log('【当前客服配置】', config); - console.log('【客服类型】', config.type); const { niushop = {}, sendMessageTitle = '', sendMessagePath = '', sendMessageImg = '' } = options; @@ -180,31 +177,24 @@ export class CustomerService { // 核心路由:根据 type 决定行为 switch (config.type) { case 'aikefu': - console.log('【跳转 AI 客服】目标路径: /pages_tool/ai-chat/index'); this.openDifyService(); break; case 'wxwork': - console.log('【跳转企业微信客服】'); this.openWxworkService(false, config, options); break; case 'third': - console.log('【跳转第三方客服】'); this.openThirdService(config); break; case 'miniprogram': - console.log('【跳转第三方小程序客服】'); this.openThirdService(config); break; case 'niushop': - console.log('【跳转牛商客服】'); this.openNiushopService(niushop); break; case 'weapp': - console.log('【跳转微信官方客服】'); this.openWeappService(config, options); break; case 'aliapp': - console.log('【跳转支付宝客服】'); this.openAliappService(config); break; default: @@ -225,7 +215,7 @@ export class CustomerService { wx.navigateToMiniProgram({ appId: 'wxeb490c6f9b154ef9', path: `pages/contacts/externalContactDetail?url=${encodeURIComponent(wxworkConfig.contact_url)}`, - success: () => console.log('跳转企业微信成功'), + success: () => {}, fail: (err) => { console.error('跳转企业微信失败:', err); this.fallbackToOriginalService(); @@ -262,24 +252,20 @@ export class CustomerService { } openThirdService(config) { - console.log('【第三方客服配置】', config); - console.log('【配置字段】', Object.keys(config)); // 支持多种可能的字段名 const miniAppId = config.mini_app_id || config.miniAppId || config.appid || config.appId || config.app_id; const miniAppPath = config.mini_app_path || config.miniAppPath || config.path || config.page_path || ''; - console.log('【解析后的小程序配置】AppID:', miniAppId, 'Path:', miniAppPath); + // 优先处理第三方微信小程序客服 if (miniAppId) { - console.log('【跳转第三方小程序】AppID:', miniAppId, 'Path:', miniAppPath); // #ifdef MP-WEIXIN wx.navigateToMiniProgram({ appId: miniAppId, path: miniAppPath, success: () => { - console.log('【跳转第三方小程序成功】'); }, fail: (err) => { console.error('【跳转第三方小程序失败】', err); @@ -295,7 +281,6 @@ export class CustomerService { // 处理第三方链接客服 if (config.third_url) { - console.log('【跳转第三方链接】', config.third_url); // #ifdef H5 window.location.href = config.third_url; // #endif @@ -326,7 +311,7 @@ export class CustomerService { // 此方法仅用于自定义跳转(如 useOfficial: false) if (config.useOfficial !== false) { // 不做任何事,应由