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);