From 7064f3751575f8bf2251610beb6db90db8831198 Mon Sep 17 00:00:00 2001 From: cmliu Date: Thu, 11 Dec 2025 18:42:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=9F=9F=E5=90=8D=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E4=B8=AA=E4=B8=BB=E6=9C=BA=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_worker.js b/_worker.js index 413d028..c7e5bef 100644 --- a/_worker.js +++ b/_worker.js @@ -305,7 +305,7 @@ export default { } } - if (!ua.includes('subconverter')) 订阅内容 = 批量替换域名(订阅内容.replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), host) + if (!ua.includes('subconverter')) 订阅内容 = 批量替换域名(订阅内容.replace(/00000000-0000-4000-8000-000000000000/g, config_JSON.UUID), hosts) if (!ua.includes('mozilla') && 订阅类型 === 'mixed') 订阅内容 = btoa(订阅内容); @@ -848,10 +848,10 @@ function 随机替换通配符(h) { }); } -function 批量替换域名(内容, host, 每组数量 = 2) { +function 批量替换域名(内容, hosts, 每组数量 = 2) { let count = 0, currentRandomHost = null; return 内容.replace(/example\.com/g, () => { - if (count % 每组数量 === 0) currentRandomHost = 随机替换通配符(host); + if (count % 每组数量 === 0) currentRandomHost = 随机替换通配符(hosts[Math.floor(Math.random() * hosts.length)]); count++; return currentRandomHost; });