hotfix plugin result is not string #5614

This commit is contained in:
lloydzhou 2024-10-10 12:47:25 +08:00
parent 19b42aac5d
commit 268cf3b606
1 changed files with 5 additions and 0 deletions

View File

@ -223,6 +223,11 @@ export function stream(
) )
.then((res) => { .then((res) => {
let content = res.data || res?.statusText; let content = res.data || res?.statusText;
// hotfix #5614
content =
typeof content === "string"
? content
: JSON.stringify(content);
if (res.status >= 300) { if (res.status >= 300) {
return Promise.reject(content); return Promise.reject(content);
} }