Vanessa 2024-03-24 22:59:10 +08:00
parent 1f607cf08a
commit 148c5a265f

View file

@ -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;