From ad99ea58c333314ec08bf51b21e7460b85282f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=A6=E5=BF=B5=E9=80=8D=E9=81=A5?= <2589141604@qq.com> Date: Sat, 3 Aug 2024 10:46:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=9C=A8cloudflare=20cdn=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E8=8E=B7=E5=8F=96ip=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/vercel/api/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/vercel/api/index.js b/src/server/vercel/api/index.js index 5c9f34b1c..059376bc2 100644 --- a/src/server/vercel/api/index.js +++ b/src/server/vercel/api/index.js @@ -979,8 +979,8 @@ async function createCollections () { function getIp (request) { try { - const { TWIKOO_IP_HEADERS } = process.env - const headers = TWIKOO_IP_HEADERS ? JSON.parse(TWIKOO_IP_HEADERS) : [] + const TWIKOO_IP_HEADERS = process.env.TWIKOO_IP_HEADERS + let headers = TWIKOO_IP_HEADERS ? JSON.parse(TWIKOO_IP_HEADERS) : [] return getUserIP(request, headers) } catch (e) { logger.error('获取 IP 错误信息:', e) From 1415ec66893198dd80df300e80f39bed29e1832d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=A6=E5=BF=B5=E9=80=8D=E9=81=A5?= <2589141604@qq.com> Date: Sat, 3 Aug 2024 10:48:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=9C=A8cloudflare=20cdn=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E8=8E=B7=E5=8F=96ip=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/self-hosted/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/self-hosted/index.js b/src/server/self-hosted/index.js index 60839e6a6..85454b6c3 100644 --- a/src/server/self-hosted/index.js +++ b/src/server/self-hosted/index.js @@ -955,8 +955,8 @@ async function createCollections () { function getIp (request) { try { - const { TWIKOO_IP_HEADERS } = process.env - const headers = TWIKOO_IP_HEADERS ? JSON.parse(TWIKOO_IP_HEADERS) : [] + const TWIKOO_IP_HEADERS = process.env.TWIKOO_IP_HEADERS + let headers = TWIKOO_IP_HEADERS ? JSON.parse(TWIKOO_IP_HEADERS) : [] return getUserIP(request, headers) } catch (e) { logger.error('获取 IP 错误信息:', e)