diff --git a/js/chat.js b/js/chat.js index e6a04aa..da6a941 100644 --- a/js/chat.js +++ b/js/chat.js @@ -156,6 +156,9 @@ $(document).ready(function () { case "insufficient_quota": layer.msg("API-KEY余额不足"); break; + case "account_deactivated": + layer.msg("账户已禁用"); + break; case null: layer.msg("OpenAI服务器访问超时或未知类型错误"); break; diff --git a/stream.php b/stream.php index f54afd3..55c9a93 100644 --- a/stream.php +++ b/stream.php @@ -37,7 +37,7 @@ $callback = function ($ch, $data) { } } else { echo $data; - $_SESSION['response'] .= $data; + $_SESSION['response'] .= 'z9J7L0b42g32' . $data; } return strlen($data); }; @@ -55,7 +55,7 @@ curl_setopt($ch, CURLOPT_WRITEFUNCTION, $callback); curl_exec($ch); $answer = ""; -$responsearr = explode("data: ", $_SESSION['response']); +$responsearr = explode("z9J7L0b42g32data: ", $_SESSION['response']); foreach ($responsearr as $msg) { $contentarr = json_decode(trim($msg), true);