From de2813b035cd75cce0911b68f246e1e1fb37889b Mon Sep 17 00:00:00 2001 From: xream Date: Fri, 13 Sep 2024 23:42:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=BC=93=E5=AD=98=E6=97=B6=20`cacheKey`=20=E7=9A=84?= =?UTF-8?q?=E5=80=BC=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/utils/download.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index d31a928ec..1ae453726 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.381", + "version": "2.14.382", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/utils/download.js b/backend/src/utils/download.js index e4dfcf682..58c0ec9bf 100644 --- a/backend/src/utils/download.js +++ b/backend/src/utils/download.js @@ -49,6 +49,11 @@ export default async function download( const requestTimeout = timeout || defaultTimeout; const id = hex_md5(userAgent + url); + if ($arguments?.cacheKey === true) { + $.error(`使用自定义缓存时 cacheKey 的值不能为空`); + $arguments.cacheKey = undefined; + } + const customCacheKey = $arguments?.cacheKey ? `#sub-store-cached-custom-${$arguments?.cacheKey}` : undefined;