mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-22 06:54:08 +01:00
This commit is contained in:
parent
fdf9f0d9e4
commit
1ac623ebb1
5 changed files with 79 additions and 17 deletions
|
|
@ -29,11 +29,11 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat
|
|||
}
|
||||
fetch(url, init).then((response) => {
|
||||
if (response.status === 404) {
|
||||
cb({
|
||||
return {
|
||||
data: null,
|
||||
msg: response.statusText,
|
||||
code: response.status,
|
||||
});
|
||||
};
|
||||
} else {
|
||||
if (response.headers.get("content-type").indexOf("application/json") > -1) {
|
||||
return response.json();
|
||||
|
|
@ -48,6 +48,9 @@ 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue