This commit is contained in:
Vanessa 2023-05-16 22:18:33 +08:00
parent 3babe0a5bb
commit 110eab8a1a
2 changed files with 15 additions and 15 deletions

View file

@ -48,15 +48,16 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat
}
return;
}
if (typeof response.msg === "undefined") {
return;
}
if (["/api/search/searchRefBlock", "/api/graph/getGraph", "/api/graph/getLocalGraph"].includes(url)) {
if (response.data.reqId && window.siyuan.reqIds[url] && window.siyuan.reqIds[url] > response.data.reqId) {
return;
}
}
if (processMessage(response) && cb) {
if (typeof response === "object" && typeof response.msg === "string" && typeof response.code === "number") {
if (processMessage(response) && cb) {
cb(response);
}
} else if (cb) {
cb(response);
}
}).catch((e) => {