mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -792,9 +792,7 @@ app.whenReady().then(() => {
|
||||
|
||||
ipcMain.on('siyuan-lock-screen', () => {
|
||||
workspaces.forEach(item => {
|
||||
const currentURL = new URL(item.browserWindow.getURL())
|
||||
const server = getServer(currentURL.port)
|
||||
fetch(server + '/api/system/logoutAuth', {method: 'POST'})
|
||||
item.browserWindow.webContents.send('siyuan-lock-screen')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@ import {getWorkspaceName} from "../menus/workspace";
|
||||
|
||||
export const lockScreen = () => {
|
||||
/// #if BROWSER
|
||||
fetchPost("/api/system/logoutAuth", {}, () => {
|
||||
window.location.href = "/";
|
||||
});
|
||||
fetchPost("/api/system/logoutAuth", {});
|
||||
/// #else
|
||||
ipcRenderer.send(Constants.SIYUAN_LOCK_SCREEN);
|
||||
/// #endif
|
||||
|
||||
@@ -347,6 +347,9 @@ const initWindow = () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
ipcRenderer.on(Constants.SIYUAN_LOCK_SCREEN, () => {
|
||||
fetchPost("/api/system/logoutAuth", {});
|
||||
});
|
||||
ipcRenderer.on(Constants.SIYUAN_SAVE_CLOSE, (event, close) => {
|
||||
winOnClose(currentWindow, close);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user