From 9634b1f19eadacef5b9868f5f819f5d678190a43 Mon Sep 17 00:00:00 2001 From: A1Panda Date: Wed, 14 May 2025 21:56:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E4=BD=BF=E7=94=A8=E6=B5=B7=E5=A4=96=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 10 ++++++++-- config/tools.yaml | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index e49248a..3dc1a50 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -314,6 +314,8 @@ export class tools extends plugin { this.aiApiKey = this.toolsConfig.aiApiKey; // ai模型 this.aiModel = this.toolsConfig.aiModel; + // 强制使用海外服务器 + this.forceOverseasServer = this.toolsConfig.forceOverseasServer; } // 翻译插件 @@ -3152,12 +3154,16 @@ export class tools extends plugin { * @return {Promise} */ async isOverseasServer() { + // 如果配置了强制使用海外服务器,则返回true + if (this.forceOverseasServer) { + return true; + } // 如果第一次使用没有值就设置 if (!(await redisExistKey(REDIS_YUNZAI_ISOVERSEA))) { await redisSetKey(REDIS_YUNZAI_ISOVERSEA, { - os: false, + os: false, // 默认不使用海外服务器 }); - return true; + return false; } // 如果有就取出来 return (await redisGetKey(REDIS_YUNZAI_ISOVERSEA)).os; diff --git a/config/tools.yaml b/config/tools.yaml index 17aa150..ed6139b 100644 --- a/config/tools.yaml +++ b/config/tools.yaml @@ -5,6 +5,7 @@ videoSizeLimit: 70 # 视频大小限制(单位MB),超过大小则转换成 proxyAddr: '127.0.0.1' # 魔法地址 proxyPort: '7890' # 魔法端口 identifyPrefix: '' # 识别前缀,比如你识别哔哩哔哩,那么就有:✅ 识别:哔哩哔哩 +forceOverseasServer: false # 是否强制使用海外服务器,设置为true时,Twitter、TikTok等平台将强制使用代理 deeplApiUrls: 'http://www.gptspt.cn/translate,http://gptspt.top/translate,http://8.134.135.4:1188/translate,http://120.76.141.173:1188/translate,http://bit.x7ys.com:1188/translate,http://deeplxapi.x7ys.com:1188/translate' From 311a314107f4cf37b2432e6bc728f32c96117a79 Mon Sep 17 00:00:00 2001 From: A1Panda Date: Wed, 14 May 2025 22:01:24 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=BC=BA=E5=88=B6=E4=BD=BF=E7=94=A8=E6=B5=B7=E5=A4=96=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E7=9A=84=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guoba.support.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/guoba.support.js b/guoba.support.js index b0ef029..1b3c831 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -64,6 +64,13 @@ export function supportGuoba() { placeholder: "请输入端口(默认:7890)", }, }, + { + field: "tools.forceOverseasServer", + label: "强制使用海外服务器", + bottomHelpMessage: "设置为开启时,Twitter、TikTok等平台将强制使用代理", + component: "Switch", + required: false, + }, { field: "tools.identifyPrefix", label: "识别前缀", From 623fc1fb29ec450b24a2b9cc1480ee4363dce79e Mon Sep 17 00:00:00 2001 From: A1Panda Date: Wed, 14 May 2025 22:32:30 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=B5=B7=E5=A4=96=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E6=8F=8F=E8=BF=B0=E5=87=86=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guoba.support.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guoba.support.js b/guoba.support.js index 1b3c831..37e113f 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -67,7 +67,7 @@ export function supportGuoba() { { field: "tools.forceOverseasServer", label: "强制使用海外服务器", - bottomHelpMessage: "设置为开启时,Twitter、TikTok等平台将强制使用代理", + bottomHelpMessage: "设置为开启时,Twitter、TikTok等平台将强制不使用代理", component: "Switch", required: false, },