mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
681bae81c5
1 changed files with 7 additions and 0 deletions
|
|
@ -42,6 +42,13 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat
|
|||
code: -response.status,
|
||||
};
|
||||
default:
|
||||
if (401 == response.status) {
|
||||
// 返回鉴权失败的话直接刷新页面,避免用户在当前页面操作 https://github.com/siyuan-note/siyuan/issues/15163
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
if (response.headers.get("content-type")?.indexOf("application/json") > -1) {
|
||||
return response.json();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue