增加评论开关,尝试修复循环依赖

This commit is contained in:
mtvpls
2025-12-03 18:20:34 +08:00
parent 567ee54c67
commit 4e05c7bcaa
11 changed files with 416 additions and 194 deletions

View File

@@ -54,6 +54,7 @@ export default async function RootLayout({
let disableYellowFilter =
process.env.NEXT_PUBLIC_DISABLE_YELLOW_FILTER === 'true';
let fluidSearch = process.env.NEXT_PUBLIC_FLUID_SEARCH !== 'false';
let enableComments = false;
let customCategories = [] as {
name: string;
type: 'movie' | 'tv';
@@ -77,6 +78,7 @@ export default async function RootLayout({
query: category.query,
}));
fluidSearch = config.SiteConfig.FluidSearch;
enableComments = config.SiteConfig.EnableComments;
}
// 将运行时配置注入到全局 window 对象,供客户端在运行时读取
@@ -89,6 +91,7 @@ export default async function RootLayout({
DISABLE_YELLOW_FILTER: disableYellowFilter,
CUSTOM_CATEGORIES: customCategories,
FLUID_SEARCH: fluidSearch,
EnableComments: enableComments,
};
return (