From 5140a4adc4e678464e7515acb543970cc8afc483 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 12 Sep 2023 15:22:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/XunFeiController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/controller/XunFeiController.php b/app/api/controller/XunFeiController.php index 729820cc9..57998a58c 100644 --- a/app/api/controller/XunFeiController.php +++ b/app/api/controller/XunFeiController.php @@ -33,12 +33,16 @@ class XunFeiController extends BaseApiController public function chat() { + $parmas=$this->request->param('content'); + if(empty($parmas)){ + return $this->success('success'); + } $chat=new ChatClient($this->app_id,$this->api_key,$this->api_secret); $client = new Client($chat->assembleAuthUrl('wss://spark-api.xf-yun.com/v2.1/chat')); // 连接到 WebSocket 服务器 if ($client) { // 发送数据到 WebSocket 服务器 - $data = $this->getBody($this->app_id,"你是谁?"); + $data = $this->getBody($this->app_id,$parmas); $client->send($data); // 从 WebSocket 服务器接收数据