Vanessa 2022-06-10 16:07:38 +08:00
parent 59aae7c87b
commit 4db338c1b0
3 changed files with 276 additions and 39 deletions

View file

@ -4,7 +4,7 @@ import {openSetting} from "../config";
/// #if !BROWSER /// #if !BROWSER
import {getCurrentWindow} from "@electron/remote"; import {getCurrentWindow} from "@electron/remote";
/// #endif /// #endif
import {getDockByType} from "../layout/util"; import {exportLayout, getDockByType} from "../layout/util";
import {fetchPost} from "../util/fetch"; import {fetchPost} from "../util/fetch";
import {getAllDocks} from "../layout/getAll"; import {getAllDocks} from "../layout/getAll";
import {hasClosestByClassName} from "../protyle/util/hasClosest"; import {hasClosestByClassName} from "../protyle/util/hasClosest";
@ -54,7 +54,9 @@ export const initToolbarMore = () => {
label: window.siyuan.languages.lockScreen, label: window.siyuan.languages.lockScreen,
click: () => { click: () => {
fetchPost("/api/system/logoutAuth", {}, () => { fetchPost("/api/system/logoutAuth", {}, () => {
window.location.href = "/"; exportLayout(false, () => {
window.location.href = "/";
})
}); });
} }
}).element); }).element);

View file

@ -11,7 +11,7 @@ import {
import {newFile} from "./newFile"; import {newFile} from "./newFile";
import {Constants} from "../constants"; import {Constants} from "../constants";
import {openSetting} from "../config"; 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 {Tab} from "../layout/Tab";
import {Editor} from "../editor"; import {Editor} from "../editor";
import {setEditMode} from "../protyle/util/setEditMode"; import {setEditMode} from "../protyle/util/setEditMode";
@ -248,7 +248,9 @@ export const globalShortcut = () => {
} }
if (matchHotKey(window.siyuan.config.keymap.general.lockScreen.custom, event)) { if (matchHotKey(window.siyuan.config.keymap.general.lockScreen.custom, event)) {
fetchPost("/api/system/logoutAuth", {}, () => { fetchPost("/api/system/logoutAuth", {}, () => {
window.location.href = "/"; exportLayout(false, () => {
window.location.href = "/";
})
}); });
event.preventDefault(); event.preventDefault();
return; return;

File diff suppressed because one or more lines are too long