diff --git a/next.config.js b/next.config.js index a249a2d..00bde2b 100644 --- a/next.config.js +++ b/next.config.js @@ -50,15 +50,15 @@ const nextConfig = { const AUTH_API_URL = process.env.NEXT_PUBLIC_JAVA_URL // const BASE_URL = 'http://192.168.120.5:8000' return [ - // Google OAuth2 回调代理 + // Google OAuth2 API代理 (排除callback,让Next.js本地处理) { - source: '/api/auth/google/:path*', - destination: `${AUTH_API_URL}/api/auth/google/:path*`, + source: '/api/auth/google/((?!callback).*)', + destination: `${AUTH_API_URL}/api/auth/google/$1`, }, - // 其他认证相关API代理 + // 其他认证相关API代理 (排除google路径) { - source: '/api/auth/:path*', - destination: `${AUTH_API_URL}/api/auth/:path*`, + source: '/api/auth/((?!google).)*', + destination: `${AUTH_API_URL}/api/auth/$1`, }, { source: '/api/user/:path*',