fix: 修复https_proxy环境变量无法设置的bug

pull/192/head
xiaojunnuo 2021-11-28 12:49:38 +08:00
parent 70ae907b5b
commit 7fef19d572
2 changed files with 7 additions and 3 deletions

View File

@ -71,8 +71,10 @@ async function _winSetProxy (exec, ip, port, setEnv) {
const proxyPath = extraPath.getProxyExePath()
await execFile(proxyPath, ['global', `${ip}:${port}`, lanIpStr])
if (setEnv == null) {
if (setEnv) {
log.info('同时设置 https_proxy')
try {
await exec('echo \'test\'')
await exec('echo \'test\'')
await exec(`setx HTTPS_PROXY "http://${ip}:${port}/"`)
// await addClearScriptIni()
@ -94,7 +96,7 @@ const executor = {
} else {
// 设置代理
log.info('设置代理', ip, port)
log.info('设置代理', ip, port, setEnv)
return _winSetProxy(exec, ip, port, setEnv)
}
},

View File

@ -119,7 +119,9 @@ function showWin () {
if (win) {
win.show()
}
app.dock.show()
if (app.dock) {
app.dock.show()
}
}
function changeAppConfig (config) {