mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f09347e49b
11 changed files with 56 additions and 24 deletions
|
|
@ -90,12 +90,18 @@ const hasKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "edito
|
|||
|
||||
export const setProxy = () => {
|
||||
/// #if !BROWSER
|
||||
const session = getCurrentWindow().webContents.session;
|
||||
if (window.siyuan.config.system.networkProxy.scheme) {
|
||||
session.closeAllConnections().then(() => {
|
||||
session.setProxy({proxyRules: `${window.siyuan.config.system.networkProxy.scheme}://${window.siyuan.config.system.networkProxy.host}:${window.siyuan.config.system.networkProxy.port}`}).then();
|
||||
});
|
||||
if ("" === window.siyuan.config.system.networkProxy.scheme) {
|
||||
console.log("network proxy [system]");
|
||||
return
|
||||
}
|
||||
|
||||
const session = getCurrentWindow().webContents.session;
|
||||
session.closeAllConnections().then(() => {
|
||||
const proxyURL = `${window.siyuan.config.system.networkProxy.scheme}://${window.siyuan.config.system.networkProxy.host}:${window.siyuan.config.system.networkProxy.port}`
|
||||
session.setProxy({proxyRules: proxyURL}).then(
|
||||
() => console.log("network proxy [" + proxyURL + "]"),
|
||||
);
|
||||
});
|
||||
/// #endif
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue