From 61ee47f7eb4985af7017263c89512da2e82d52d2 Mon Sep 17 00:00:00 2001 From: dirk1983 Date: Sun, 12 Mar 2023 10:40:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/chat.js | 3 +++ stream.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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);