chore(src): 终端获得AI智能客服配置

This commit is contained in:
2025-12-08 09:06:37 +08:00
parent e4bb99aa1f
commit cfd791f148
2 changed files with 11 additions and 7 deletions

View File

@@ -124,6 +124,9 @@ class Config extends BaseApi
$copyright = $config_model->getCopyright($this->site_id, 'shop')[ 'data' ][ 'value' ];
$map_config = $config_model->getMapConfig($this->site_id, 'shop')[ 'data' ][ 'value' ];
// 智能客服配置信息
$aikefu_config = event('KefuGetInfo', ['site_id' => $this->site_id]);
$website_model = new SiteModel();
$site_info = $website_model->getSiteInfo([ [ 'site_id', '=', $this->site_id ] ], 'site_id,site_domain,site_name,logo,seo_title,seo_keywords,seo_description,site_tel,logo_square')[ 'data' ];
@@ -146,7 +149,8 @@ class Config extends BaseApi
'servicer' => $servicer_info,
'shop_info'=>$shop_info,
'store_config' => $this->store_data[ 'config' ],
'map_config' => $map_config
'map_config' => $map_config,
'aikefu_config' => $aikefu_config,
];
if (!empty($this->store_data[ 'store_info' ])) {
$res[ 'store_info' ] = $this->store_data[ 'store_info' ];

View File

@@ -157,7 +157,7 @@ class Kefu extends BaseApi
];
// 触发获取配置信息事件
$result = Event::trigger('KefuGetInfo', $event_data);
$result = event('KefuGetInfo', $event_data);
// 处理事件结果
$response = [
@@ -238,7 +238,7 @@ class Kefu extends BaseApi
];
// 触发清除会话事件
$result = Event::trigger('KefuClearConversation', $event_data);
$result = event('KefuClearConversation', $event_data);
// 处理事件结果
$response = [
@@ -300,7 +300,7 @@ class Kefu extends BaseApi
];
// 触发智能客服聊天事件
$result = Event::trigger('KefuChat', $event_data);
$result = event('KefuChat', $event_data);
// 处理事件结果
$response = [
@@ -373,7 +373,7 @@ class Kefu extends BaseApi
]);
// 触发流式聊天事件
$result = Event::trigger('KefuChatStream', $event_data);
$result = event('KefuChatStream', $event_data);
// 处理事件结果并流式输出
$this->processStreamResults($result, $event_data);
@@ -520,7 +520,7 @@ class Kefu extends BaseApi
];
// 触发创建会话事件
$result = Event::trigger('KefuCreateConversation', $event_data);
$result = event('KefuCreateConversation', $event_data);
// 处理事件结果
$response = [
@@ -582,7 +582,7 @@ class Kefu extends BaseApi
];
// 触发获取历史消息事件
$result = Event::trigger('KefuGetHistory', $event_data);
$result = event('KefuGetHistory', $event_data);
// 处理事件结果
$response = [