From ab0946b14b96b5a2334fa1cbde106dcb915e23aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Thu, 5 Sep 2024 14:22:12 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E4=B8=8B=E8=BD=BD=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E8=BF=9C=E7=AB=AF=E6=9C=8D=E5=8A=A1=E5=99=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=BC=93=E5=AD=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/src/config.js b/packages/core/src/config.js index d32dba3..956baff 100644 --- a/packages/core/src/config.js +++ b/packages/core/src/config.js @@ -84,11 +84,13 @@ const configApi = { return new Promise((resolve, reject) => { log.info('开始下载远程配置:', remoteConfigUrl) - const headers = {} + const headers = { + 'Cache-Control': 'no-cache' // 禁止使用缓存 + } if (remoteConfigUrl.startsWith('https://raw.githubusercontent.com/')) { headers['Server-Name'] = 'baidu.com' } - request(remoteConfigUrl, headers, (error, response, body) => { + request(remoteConfigUrl, { headers }, (error, response, body) => { if (error) { log.error('下载远程配置失败, error:', error, ', response:', response, ', body:', body) reject(error)