From 51aa21e5513e43e11777e83a67910867ba703d9c Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Fri, 13 Nov 2020 20:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=8D=E5=BE=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Setting.vue | 4 ++-- src/lib/site/tools.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Setting.vue b/src/components/Setting.vue index 01a9f1b..6da8803 100644 --- a/src/components/Setting.vue +++ b/src/components/Setting.vue @@ -348,7 +348,7 @@ export default { this.show.proxyDialog = false this.setting.proxy.type = 'none' this.updateSettingEvent() - this.$message.info('未使用代理') + this.$message.info('取消使用代理') } this.inputPassword = '' }, @@ -423,7 +423,7 @@ export default { this.d.proxy.port = this.proxy.port await this.updateSettingEvent() this.show.proxyDialog = false - await zy.proxy() + zy.proxy() this.$message.info('开始使用代理') }, clearDBEvent () { diff --git a/src/lib/site/tools.js b/src/lib/site/tools.js index 7c5aad5..ca01db8 100644 --- a/src/lib/site/tools.js +++ b/src/lib/site/tools.js @@ -377,6 +377,7 @@ const zy = { if (db.proxy) { if (db.proxy.type === 'none') { session.setProxy({ proxyRules: 'direct://' }) + http.globalAgent = https.globalAgent = new ElectronProxyAgent(session) } else if (db.proxy.type === 'manual') { if (db.proxy.scheme && db.proxy.url && db.proxy.port) { const proxyURL = db.proxy.scheme + '://' + db.proxy.url.trim() + ':' + db.proxy.port.trim()