This commit is contained in:
parent
1f607cf08a
commit
148c5a265f
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue