From a0ae935ada713c6a5e0b90d80ac843dccb88b653 Mon Sep 17 00:00:00 2001 From: CaffeinePower Date: Fri, 3 Feb 2023 12:24:32 +0900 Subject: [PATCH] [fix] http 204 parse json --- src/ai.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ai.ts b/src/ai.ts index f185664..6f1870f 100644 --- a/src/ai.ts +++ b/src/ai.ts @@ -427,7 +427,14 @@ export default class 藍 { body: JSON.stringify({ ...{ i: config.i }, ...param }), - }).then(res => res.json()); + }).then(res => { + if(res.status != 204) + return res.json(); + + return new Promise((resolve, reject) => { + resolve(JSON.parse("{}")); + }) + }); } /**