feat: 接入公开币种目录并统一多币种金额与语言初始化处理

This commit is contained in:
2026-05-21 15:14:00 +08:00
parent 626914feb6
commit 6b18e25766
27 changed files with 277 additions and 94 deletions

View File

@@ -9,8 +9,12 @@ const ALLOWED_PARENT_ORIGINS: string[] = [
process.env.NEXT_PUBLIC_MAIN_SITE_URL,
process.env.NEXT_PUBLIC_PARENT_ORIGIN,
// 开发环境
"http://localhost:5173",
"http://127.0.0.1:5173",
"http://192.168.0.101:5173",
"http://localhost:3801",
"http://127.0.0.1:3801",
"http://192.168.0.101:3801",
// 生产环境应从环境变量读取
].filter((o): o is string => Boolean(o));
@@ -58,8 +62,6 @@ export function generateCSP(): string {
// 表单提交允许同源
"form-action": ["'self'"],
// 不升级 HTTPS
"upgrade-insecure-requests": [],
};
// 构建 CSP 字符串
@@ -90,10 +92,6 @@ export const securityHeaders = [
key: "Content-Security-Policy",
value: generateCSP(),
},
{
key: "X-Frame-Options",
value: "SAMEORIGIN", // 允许同源,通过 CSP frame-ancestors 控制跨域
},
{
key: "X-Content-Type-Options",
value: "nosniff",