This commit is contained in:
Vanessa 2023-01-12 16:43:22 +08:00
parent 1165f4def2
commit 8a5ca0548d
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

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