作者 lyh

gx

... ... @@ -86,6 +86,31 @@ class ChatLogic extends BaseLogic
}
/**
* @remark :获取一行数据
* @name :getStreamContentLine
* @author :lyh
* @method :post
* @time :2025/4/2 22:42
*/
public function getStreamContentLine($stream){
$text = '';
while (!$stream->eof()){
// 读取一个字符串
$t = $this->stream->read(1);
$this->body .= $t;
if($t === "\n"){
break;
}
// 结束了
if(ord($t)==1){
break;
}
$text .= $t;
}
return $text;
}
/**
* @remark :创建一条新会话
* @name :saveChat
* @author :lyh
... ...