From 03f8facde084dd7d6625e3c48e3a14f16303e57a Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 22 Nov 2025 02:07:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9D=9E=20json=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=A0=E6=B3=95=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/api/Client.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/api/Client.ts b/client/api/Client.ts index b88886c..7f2bd6b 100644 --- a/client/api/Client.ts +++ b/client/api/Client.ts @@ -165,8 +165,15 @@ class Client { body: form, credentials: 'omit', }) + const text = await (await re.blob()).text() + let json + try { + json = JSON.parse(text) + } catch(_) {} return { - ...await re.json(), + ...(json == null ? { + msg: text + } : json), code: re.status, } as ApiCallbackMessage }