From d8d49f7e88f6fe5a096ff84374e973a4d43b7775 Mon Sep 17 00:00:00 2001 From: Sisyphus Date: Fri, 26 Jun 2026 17:12:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E7=99=BB=E5=BD=95=E5=8F=8C/api=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API_BASE为空时用||替代??,确保fallback到localhost:4000 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- apps/web/.env.production | 2 +- apps/web/src/components/Sidebar.tsx | 2 +- apps/web/src/lib/apiBase.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/.env.production b/apps/web/.env.production index 3c51e33..afb3e74 100644 --- a/apps/web/.env.production +++ b/apps/web/.env.production @@ -1 +1 @@ -NEXT_PUBLIC_API_URL=/api +NEXT_PUBLIC_API_URL= diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 1164019..7b2f742 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -81,7 +81,7 @@ export default function Sidebar({ }`} > 📋 - 线索池 + 询价发布助手 {[ diff --git a/apps/web/src/lib/apiBase.ts b/apps/web/src/lib/apiBase.ts index d8d5055..5a1d4f2 100644 --- a/apps/web/src/lib/apiBase.ts +++ b/apps/web/src/lib/apiBase.ts @@ -1 +1 @@ -export const API_BASE: string = process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:4000' +export const API_BASE: string = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'