diff --git a/app/src/menus/toolbar.ts b/app/src/menus/toolbar.ts index 3d2739783..2bdeda996 100644 --- a/app/src/menus/toolbar.ts +++ b/app/src/menus/toolbar.ts @@ -4,7 +4,7 @@ import {openSetting} from "../config"; /// #if !BROWSER import {getCurrentWindow} from "@electron/remote"; /// #endif -import {getDockByType} from "../layout/util"; +import {exportLayout, getDockByType} from "../layout/util"; import {fetchPost} from "../util/fetch"; import {getAllDocks} from "../layout/getAll"; import {hasClosestByClassName} from "../protyle/util/hasClosest"; @@ -54,7 +54,9 @@ export const initToolbarMore = () => { label: window.siyuan.languages.lockScreen, click: () => { fetchPost("/api/system/logoutAuth", {}, () => { - window.location.href = "/"; + exportLayout(false, () => { + window.location.href = "/"; + }) }); } }).element); diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 56bbf36fd..6b0aaedf5 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -11,7 +11,7 @@ import { import {newFile} from "./newFile"; import {Constants} from "../constants"; import {openSetting} from "../config"; -import {getDockByType, getInstanceById, setPanelFocus} from "../layout/util"; +import {exportLayout, getDockByType, getInstanceById, setPanelFocus} from "../layout/util"; import {Tab} from "../layout/Tab"; import {Editor} from "../editor"; import {setEditMode} from "../protyle/util/setEditMode"; @@ -248,7 +248,9 @@ export const globalShortcut = () => { } if (matchHotKey(window.siyuan.config.keymap.general.lockScreen.custom, event)) { fetchPost("/api/system/logoutAuth", {}, () => { - window.location.href = "/"; + exportLayout(false, () => { + window.location.href = "/"; + }) }); event.preventDefault(); return; diff --git a/app/stage/auth.html b/app/stage/auth.html index f67d624f9..2dc9dd3c9 100644 --- a/app/stage/auth.html +++ b/app/stage/auth.html @@ -5,6 +5,10 @@