mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
This commit is contained in:
parent
aaec2300a9
commit
a8a2fe8529
3 changed files with 5 additions and 6 deletions
|
|
@ -792,9 +792,7 @@ app.whenReady().then(() => {
|
||||||
|
|
||||||
ipcMain.on('siyuan-lock-screen', () => {
|
ipcMain.on('siyuan-lock-screen', () => {
|
||||||
workspaces.forEach(item => {
|
workspaces.forEach(item => {
|
||||||
const currentURL = new URL(item.browserWindow.getURL())
|
item.browserWindow.webContents.send('siyuan-lock-screen')
|
||||||
const server = getServer(currentURL.port)
|
|
||||||
fetch(server + '/api/system/logoutAuth', {method: 'POST'})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@ import {getWorkspaceName} from "../menus/workspace";
|
||||||
|
|
||||||
export const lockScreen = () => {
|
export const lockScreen = () => {
|
||||||
/// #if BROWSER
|
/// #if BROWSER
|
||||||
fetchPost("/api/system/logoutAuth", {}, () => {
|
fetchPost("/api/system/logoutAuth", {});
|
||||||
window.location.href = "/";
|
|
||||||
});
|
|
||||||
/// #else
|
/// #else
|
||||||
ipcRenderer.send(Constants.SIYUAN_LOCK_SCREEN);
|
ipcRenderer.send(Constants.SIYUAN_LOCK_SCREEN);
|
||||||
/// #endif
|
/// #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) => {
|
ipcRenderer.on(Constants.SIYUAN_SAVE_CLOSE, (event, close) => {
|
||||||
winOnClose(currentWindow, close);
|
winOnClose(currentWindow, close);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue