From 148c5a265f5986be43af0f46952cf774f15b4a14 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 24 Mar 2024 22:59:10 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/10715 --- app/src/util/fetch.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/util/fetch.ts b/app/src/util/fetch.ts index ca59ab111..3e258a94f 100644 --- a/app/src/util/fetch.ts +++ b/app/src/util/fetch.ts @@ -85,7 +85,11 @@ export const fetchSyncPost = async (url: string, data?: any) => { method: "POST", }; if (data) { - init.body = JSON.stringify(data); + if (data instanceof FormData) { + init.body = data; + } else { + init.body = JSON.stringify(data); + } } const res = await fetch(url, init); const res2 = await res.json() as IWebSocketData;