feat: init redis storage

This commit is contained in:
shinya
2025-07-02 13:13:22 +08:00
parent 87b65fc7b4
commit 7b3afce1a1
11 changed files with 815 additions and 116 deletions

View File

@@ -33,8 +33,25 @@ export default function RootLayout({
process.env.ANNOUNCEMENT ||
'本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。';
// 将运行时配置注入到全局 window 对象,供客户端在运行时读取
const runtimeConfig = {
STORAGE_TYPE:
process.env.STORAGE_TYPE ||
process.env.NEXT_PUBLIC_STORAGE_TYPE ||
'localstorage',
};
return (
<html lang='zh-CN' suppressHydrationWarning>
<head>
{/* 将配置序列化后直接写入脚本,浏览器端可通过 window.RUNTIME_CONFIG 获取 */}
{/* eslint-disable-next-line @next/next/no-sync-scripts */}
<script
dangerouslySetInnerHTML={{
__html: `window.RUNTIME_CONFIG = ${JSON.stringify(runtimeConfig)};`,
}}
/>
</head>
<body
className={`${inter.className} min-h-screen bg-white text-gray-900 dark:bg-black dark:text-gray-200`}
>