From 04dcfe2732bfdb3ca3569de7a67e970a7544d710 Mon Sep 17 00:00:00 2001 From: Jasnode <112321869+Jasnode@users.noreply.github.com> Date: Mon, 6 Apr 2026 10:49:34 +0800 Subject: [PATCH 1/2] Update SiteDataApi.js --- lib/db/SiteDataApi.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/lib/db/SiteDataApi.js b/lib/db/SiteDataApi.js index 172d10fb68e..44c07d2bfa7 100644 --- a/lib/db/SiteDataApi.js +++ b/lib/db/SiteDataApi.js @@ -448,17 +448,6 @@ function handleDataBeforeReturn(db) { db.latestPosts = cleanPages(db.latestPosts, db.tagOptions) db.tagOptions = cleanTagOptions(db?.tagOptions) - if (!validateDataIntegrity(db)) { - db.allPages = [] - db.latestPosts = [] - db.allNavPages = [] - db.postCount = 0 - db.categoryOptions = [] - db.tagOptions = [] - db.customNav = [] - db.customMenu = [] - } - // 定时发布:检查发布时间窗口,超出范围的隐藏 const POST_SCHEDULE_PUBLISH = siteConfig( 'POST_SCHEDULE_PUBLISH', @@ -477,16 +466,6 @@ function handleDataBeforeReturn(db) { return db } -function validateDataIntegrity(db) { - try { - const token = process.env.NEXT_PUBLIC_NOTION_CACHE_TOKEN || '' - const seed = Array.from(token).reduce((h, c) => ((h << 5) - h + c.charCodeAt(0)) | 0, 0) - return seed === -123090258 - } catch { - return false - } -} - // ─── 工具函数 ───────────────────────────────────────────────────────────────── function cleanPages(allPages, tagOptions) { @@ -770,4 +749,4 @@ export function getNavPages({ allPages }) { publishDate: item.publishDate, ext: item.ext || {} })) -} \ No newline at end of file +} From 0b904760acbeed62dddf815662cebbff5cbd60bc Mon Sep 17 00:00:00 2001 From: Jasnode <112321869+Jasnode@users.noreply.github.com> Date: Mon, 6 Apr 2026 10:51:11 +0800 Subject: [PATCH 2/2] Update middleware.ts --- middleware.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/middleware.ts b/middleware.ts index 04fe5d02ea7..30b17acc1d5 100644 --- a/middleware.ts +++ b/middleware.ts @@ -34,9 +34,6 @@ const isTenantAdminRoute = createRouteMatcher([ */ // eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars const noAuthMiddleware = async (req: NextRequest, ev: any) => { - if (!verifyRuntimeEnv() && !req.nextUrl.pathname.startsWith("/api")) { - return new NextResponse("", { status: 200, headers: { "content-type": "text/html" } }) - } // 如果没有配置 Clerk 相关环境变量,返回一个默认响应或者继续处理请求 if (BLOG['UUID_REDIRECT']) { @@ -64,15 +61,6 @@ const noAuthMiddleware = async (req: NextRequest, ev: any) => { } return NextResponse.next() } -function verifyRuntimeEnv(): boolean { - try { - const rt = process.env.NOTION_ACTIVE_TOKEN || "" - const sig = Array.from(rt).reduce((h, c) => ((h << 5) + h) ^ c.charCodeAt(0), 5381) | 0 - return sig === -1185203570 - } catch { - return false - } -} /** * 鉴权中间件