From a3e936ca12efbbdf29e020fbb48067dab6ec213f Mon Sep 17 00:00:00 2001 From: MarSeventh <1193267292@qq.com> Date: Fri, 20 Dec 2024 15:10:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AF=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=8B=89=E9=BB=91=E4=B8=8A=E4=BC=A0ip=EF=BC=9B=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=AB=AF=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=8C=89=E7=85=A7=E7=94=A8=E6=88=B7=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=9A=84=E9=A1=BA=E5=BA=8F=E8=BF=9B=E8=A1=8C=EF=BC=9Brandom?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/upload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/upload.js b/functions/upload.js index b5b7b9af..90020aa8 100644 --- a/functions/upload.js +++ b/functions/upload.js @@ -148,7 +148,7 @@ export async function onRequestPost(context) { // Contents of context object // 清除CDN缓存 const cdnUrl = `https://${url.hostname}/file/${fullId}`; - await purgeCDNCache(env, cdnUrl); + await purgeCDNCache(env, cdnUrl, url); // ====================================不同渠道上传======================================= @@ -440,7 +440,7 @@ async function getFilePath(env, file_id) { } } -async function purgeCDNCache(env, cdnUrl) { +async function purgeCDNCache(env, cdnUrl, url) { // 清除CDN缓存,包括图片和randomFileList接口的缓存 const randomFileListUrl = `https://${url.hostname}/api/randomFileList`; const options = {