Преглед на файлове

hotfix plugin result is not string #5614

lloydzhou преди 1 година
родител
ревизия
268cf3b606
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      app/utils/chat.ts

+ 5 - 0
app/utils/chat.ts

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