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