Files
ViGent2/frontend/next.config.ts
Kevin Wong 6c6fbae13a 更新
2026-02-03 17:12:30 +08:00

28 lines
747 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// 允许跨域请求后端 API
async rewrites() {
return [
{
source: '/api/:path*',
destination: 'http://localhost:8006/api/:path*', // 服务器本地代理
},
{
source: '/uploads/:path*',
destination: 'http://localhost:8006/uploads/:path*', // 转发上传的素材
},
{
source: '/outputs/:path*',
destination: 'http://localhost:8006/outputs/:path*', // 转发生成的视频
},
{
source: '/assets/:path*',
destination: 'http://localhost:8006/assets/:path*', // 转发静态资源(字体/音乐)
},
];
},
};
export default nextConfig;