This commit is contained in:
Vanessa 2023-05-23 10:03:56 +08:00
parent 7b0cfbe0b4
commit e28a21de79

View file

@ -35,7 +35,7 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat
code: response.status,
};
} else {
if (response.headers.get("content-type").indexOf("application/json") > -1) {
if (response.headers.get("content-type")?.indexOf("application/json") > -1) {
return response.json();
} else {
return response.text();