From 34b45642895238b61a8cd652dd02f1dd2fd3c6b3 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 29 Jun 2025 22:09:06 +0800 Subject: [PATCH] :art: When access authentication fails, refresh the page to jump to the authentication page https://github.com/siyuan-note/siyuan/issues/15163 --- app/src/util/fetch.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/util/fetch.ts b/app/src/util/fetch.ts index 40bfe63dc..e6948f82f 100644 --- a/app/src/util/fetch.ts +++ b/app/src/util/fetch.ts @@ -34,6 +34,9 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat } fetch(url, init).then((response) => { switch (response.status) { + case 401: + // 返回鉴权失败的话直接刷新页面,避免用户在当前页面操作 https://github.com/siyuan-note/siyuan/issues/15163 + window.location.reload(); case 403: case 404: return {