|
|
|
@ -27,6 +27,9 @@ class Chat extends BaseController |
|
|
|
$userInfo = $this->userInfo; |
|
|
|
$uid = $userInfo['id']; |
|
|
|
|
|
|
|
if (!isset($postData['choices'][0]['message']['content'])) { |
|
|
|
return warning(lang('system.fail')); |
|
|
|
} |
|
|
|
$newContent = $postData['choices'][0]['message']['content']; |
|
|
|
$newContent = '<p>' . $newContent . "</p>"; |
|
|
|
|
|
|
|
@ -126,12 +129,14 @@ class Chat extends BaseController |
|
|
|
curl_close($curl); |
|
|
|
|
|
|
|
if ($err) { |
|
|
|
$this->error = "cURL Error #:" . $err; |
|
|
|
// $this->error = "cURL Error #:" . $err; |
|
|
|
$this->error = lang('system.fail'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
$response = json_decode($response,true); |
|
|
|
if (!is_array($response)) { |
|
|
|
$this->error = "cURL Error #:" . $response; |
|
|
|
//$this->error = "cURL Error #:" . $response; |
|
|
|
$this->error = lang('system.fail'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return $response; |
|
|
|
|