import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ images: { remotePatterns: [ { protocol: 'https', hostname: 'lh3.googleusercontent.com', port: '', pathname: '/**', }, { protocol: 'http', hostname: 'googleusercontent.com', port: '', pathname: '/**', }, ], }, async rewrites() { return [ { // 捕获所有以 /v1/media/ 开头的图片请求 source: '/v1/media/:path*', // 悄悄转发给 FastAPI 后端 destination: `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000'}/v1/media/:path*`, }, ]; }, }; export default nextConfig;