From 2c47de6599c8ad627f0bfa83b0d3db7b0da3f871 Mon Sep 17 00:00:00 2001 From: vpt Date: Tue, 10 Jan 2023 16:43:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'clash.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clash.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clash.js b/clash.js index 6ae2ff3..53fb750 100644 --- a/clash.js +++ b/clash.js @@ -13,16 +13,16 @@ module.exports.parse = async(raw, utils, meta) => { // 配置预先规则 async function configPrependRules(utils, obj) { - const { axios,console } = utils + const { axios } = utils const proxyGroupName = getProxyGroupName(obj) const directGroupName = getDirectGroupName(obj) try { - const directResponse = await axios.get('https://git.yevpt.com/vpt/public-data/raw/branch/master/direct') + const noCacheDate = '?nocachekey=' + Date.now() + const directResponse = await axios.get('https://git.yevpt.com/vpt/public-data/raw/branch/master/direct' + noCacheDate) const directs = directResponse.data const prependDirectRules = directs.split(`\n`).map(item => `DOMAIN-SUFFIX,${item},${directGroupName}`) - const proxyResponse = await axios.get('https://git.yevpt.com/vpt/public-data/raw/branch/master/proxy') + const proxyResponse = await axios.get('https://git.yevpt.com/vpt/public-data/raw/branch/master/proxy' + noCacheDate) const proxys = proxyResponse.data - console.log('proxys',proxys.split(`\n`).slice(-5)) const prependProxyRules = proxys.split(`\n`).map(item => `DOMAIN-SUFFIX,${item},${proxyGroupName}`) const prependRules = [...prependDirectRules, ...prependProxyRules] obj.rules = [...prependRules, ...obj.rules]