gongxiangp2/next.config.js
chenpei ea9076df45 feat: 实现统一的下载错误处理系统并修复产品全案数据库Schema
- 创建统一的下载错误处理模块 (lib/download-errors.ts)
- 实现13种错误类型分类和中文错误消息
- 后端统一使用 createDownloadError 创建标准化错误响应
- 前端统一使用 parseDownloadError 解析错误并显示
- 修复正式系统数据库Schema,添加产品全案相关字段和表
- 执行数据库迁移:添加 task_no, task_status, task_fetched_at 字段
- 创建 material_assets, api_keys, api_call_logs 表
2026-01-05 17:52:42 +08:00

64 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 's3.1080p.hk',
},
{
protocol: 'http',
hostname: 's3.1080p.hk',
},
{
protocol: 'https',
hostname: 's3.yydd.ai',
},
{
protocol: 'http',
hostname: 's3.yydd.ai',
},
],
},
experimental: {
serverActions: {
bodySizeLimit: '10gb', // Server Actions 的限制 (10GB)
},
},
// 注意:CORS配置移到middleware.ts中处理,因为需要动态设置origin
// 当使用credentials时,不能使用通配符*
// 添加版本号到静态资源文件名,强制浏览器更新
generateBuildId: async () => {
// 使用时间戳作为构建ID,确保每次部署都有新的版本号
return `build-${Date.now()}`
},
// 配置 headers 来禁用缓存
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
],
},
]
},
}
module.exports = nextConfig