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()