From d84bb7fd9071054a61917ee68f0bb36ef2f54c19 Mon Sep 17 00:00:00 2001 From: yutian81 Date: Wed, 19 Nov 2025 13:04:09 +0800 Subject: [PATCH] Update index.js --- src/index.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/index.js b/src/index.js index 90affa3..c396ed0 100644 --- a/src/index.js +++ b/src/index.js @@ -53,7 +53,8 @@ export default { return handleLogin(request, env); } - const config = getConfig(env); + const config = getConfig(env); // 加载环境变量 + // 定义需要豁免认证的路径 const authExemptPaths = ['/api/config', '/cron', '/login']; const isExempt = authExemptPaths.includes(pathname); @@ -77,14 +78,7 @@ export default { // 处理根目录请求 if (pathname === '/') { - return new Response(HTML_TEMPLATE( - config.siteName, - config.siteIcon, - config.bgimgURL, - config.githubURL, - config.blogURL, - config.blogName - ), { + return new Response(HTML_TEMPLATE(config.siteName, config.siteIcon, config.bgimgURL, config.githubURL, config.blogURL, config.blogName), { headers: { 'Content-Type': 'text/html;charset=UTF-8', 'Cache-Control': 'no-cache, no-store, must-revalidate'