From 8a5ca0548da5005a11e1edfb1d4f9bbcb5700aac Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 12 Jan 2023 16:43:22 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/7042 --- app/src/dialog/processSystem.ts | 4 +++- app/src/util/onGetConfig.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index 5aa796a28..af20f6adf 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -14,7 +14,9 @@ import {getWorkspaceName} from "../menus/workspace"; export const lockScreen = () => { /// #if BROWSER - fetchPost("/api/system/logoutAuth", {}); + fetchPost("/api/system/logoutAuth", {}, () => { + window.location.href = "/"; + }); /// #else ipcRenderer.send(Constants.SIYUAN_LOCK_SCREEN); /// #endif diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.ts index 48f110b40..0da2fe22d 100644 --- a/app/src/util/onGetConfig.ts +++ b/app/src/util/onGetConfig.ts @@ -348,7 +348,11 @@ const initWindow = () => { }); }); ipcRenderer.on(Constants.SIYUAN_LOCK_SCREEN, () => { - fetchPost("/api/system/logoutAuth", {}); + exportLayout(false, () => { + fetchPost("/api/system/logoutAuth", {}, () => { + window.location.reload(); + }); + }); }); ipcRenderer.on(Constants.SIYUAN_SAVE_CLOSE, (event, close) => { winOnClose(currentWindow, close);