From 0655bbc87519944a82198568458f8f6feeec57ac Mon Sep 17 00:00:00 2001 From: mtvpls Date: Thu, 15 Jan 2026 15:11:36 +0800 Subject: [PATCH] =?UTF-8?q?openlist=E6=89=AB=E6=8F=8F=E5=89=8D=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0tmdbkey=E9=85=8D=E7=BD=AE=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/openlist/refresh/route.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/api/openlist/refresh/route.ts b/src/app/api/openlist/refresh/route.ts index 3e771e9..d7fb8c5 100644 --- a/src/app/api/openlist/refresh/route.ts +++ b/src/app/api/openlist/refresh/route.ts @@ -3,6 +3,7 @@ import { NextRequest, NextResponse } from 'next/server'; import { getAuthInfoFromCookie } from '@/lib/auth'; +import { getConfig } from '@/lib/config'; import { startOpenListRefresh } from '@/lib/openlist-refresh'; export const runtime = 'nodejs'; @@ -19,6 +20,15 @@ export async function POST(request: NextRequest) { return NextResponse.json({ error: '未授权' }, { status: 401 }); } + // 检查 TMDB API Key 是否配置 + const config = await getConfig(); + if (!config.SiteConfig.TMDBApiKey || config.SiteConfig.TMDBApiKey.trim() === '') { + return NextResponse.json( + { error: '请先在站点配置中配置 TMDB API Key' }, + { status: 400 } + ); + } + // 获取请求参数 const body = await request.json().catch(() => ({})); const clearMetaInfo = body.clearMetaInfo === true;