From 7580d8b763e19cdae58b611b193412ffcebdbecd Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Sat, 16 May 2026 17:34:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(ai-chat):=20=E6=B7=BB=E5=8A=A0=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E8=AE=B0=E5=BD=95=E6=90=9C=E7=B4=A2=E4=B8=8E=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E6=AC=A2=E8=BF=8E=E8=AF=AD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/ai-service.js | 29 ++ pages_tool/ai-chat/ai-chat-message.vue | 378 ++++++++++++++++++++++++- pages_tool/ai-chat/index.vue | 12 +- 3 files changed, 403 insertions(+), 16 deletions(-) diff --git a/common/js/ai-service.js b/common/js/ai-service.js index 3328545..40d0cae 100644 --- a/common/js/ai-service.js +++ b/common/js/ai-service.js @@ -1,6 +1,7 @@ import Config from './config.js' import http from './http.js' import store from '@/store/index.js' +import lang from './lang.js' let currentConversationId = null; export const CONVERSATION_KEY = 'ai_conversation_id'; @@ -524,6 +525,34 @@ export default { } }, + /** + * 获取服务配置信息 + */ + async getServiceConfig() { + try { + const params = { + url: '/api/kefu/info', + data: { + uniacid: this.getUniacid(), + token: store.state.token || 'test_token', + user_id: getUserId(), + member_id: getUserId(), + locale: lang.getCurrentLocale() + }, + header: { + 'Content-Type': 'application/json' + } + }; + const response = await http.sendRequest({ + ...params, + async: false, + }); + return response.data; + } catch (error) { + return null; + } + }, + /** * 清除会话历史(调用后端接口) */ diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue index a62a8ce..7b227eb 100644 --- a/pages_tool/ai-chat/ai-chat-message.vue +++ b/pages_tool/ai-chat/ai-chat-message.vue @@ -1,5 +1,10 @@