From 434518b2b38ea232238e601ea617714598985742 Mon Sep 17 00:00:00 2001 From: riverLethe <865192079@qq.com> Date: Mon, 20 Oct 2025 14:57:33 +0800 Subject: [PATCH] feat/op:uploads path use rewrite --- frontend/next.config.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/frontend/next.config.js b/frontend/next.config.js index 17b0e72..3ff5566 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -19,18 +19,20 @@ const nextConfig = { async redirects() { return []; }, - // async rewrites() { - // return [ - // { - // source: "/api/:path*", - // destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/api/:path*`, - // }, - // { - // source: "/uploads/:path*", - // destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/uploads/:path*`, - // }, - // ]; - // }, + async rewrites() { + return [ + // { + // source: "/api/:path*", + // destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/api/:path*`, + // }, + { + source: "/uploads/:path*", + destination: `${ + process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001" + }/uploads/:path*`, + }, + ]; + }, // Headers for better performance async headers() {