- 在 .env.example 中新增 i18next 相关配置项以支持多语言功能 - 在 next.config.ts 中添加安全头配置以支持 iframe 嵌入 - 更新 Providers 组件以引入 i18n 配置 - 在 PlayerAppShell 中集成 LanguageSwitcher 组件以实现语言切换功能 - 优化 HallWalletStrip 组件的网络状态管理逻辑 - 更新多个组件以支持国际化文本
32 lines
614 B
TypeScript
32 lines
614 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
import { securityHeaders } from "./src/lib/csp-config";
|
|
|
|
const lotteryApiProxyTarget =
|
|
process.env.LOTTERY_API_PROXY_TARGET?.trim() || "http://127.0.0.1:8000";
|
|
|
|
const nextConfig: NextConfig = {
|
|
reactCompiler: true,
|
|
|
|
// 安全头配置 - 支持 iframe 嵌入
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/:path*",
|
|
headers: securityHeaders,
|
|
},
|
|
];
|
|
},
|
|
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: "/api/:path*",
|
|
destination: `${lotteryApiProxyTarget}/api/:path*`,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|