From 676b18868f9ff0a02991a66e15a20aa3a7d98dba Mon Sep 17 00:00:00 2001 From: cmliu Date: Sat, 10 Jan 2026 05:32:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96CF=5FJSON=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E5=A4=84=E7=90=86UsageAPI=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/_worker.js b/_worker.js index 4556ec0..898183a 100644 --- a/_worker.js +++ b/_worker.js @@ -127,15 +127,11 @@ export default { if (newConfig.Email && newConfig.GlobalAPIKey) { CF_JSON.Email = newConfig.Email; CF_JSON.GlobalAPIKey = newConfig.GlobalAPIKey; - CF_JSON.AccountID = null; - CF_JSON.APIToken = null; - CF_JSON.UsageAPI = null; } else if (newConfig.AccountID && newConfig.APIToken) { - CF_JSON.Email = null; - CF_JSON.GlobalAPIKey = null; CF_JSON.AccountID = newConfig.AccountID; CF_JSON.APIToken = newConfig.APIToken; - CF_JSON.UsageAPI = null; + } else if (newConfig.UsageAPI){ + CF_JSON.UsageAPI = newConfig.UsageAPI; } else { return new Response(JSON.stringify({ error: '配置不完整' }), { status: 400, headers: { 'Content-Type': 'application/json;charset=utf-8' } }); }