From 478100200dff8400a6e47502fa4a6db035fd6532 Mon Sep 17 00:00:00 2001
From: blackhao <13851610112@163.com>
Date: Wed, 10 Dec 2025 21:07:17 -0600
Subject: fix: use relative API paths for production deployment

---
 frontend/src/components/LeftSidebar.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'frontend/src/components/LeftSidebar.tsx')

diff --git a/frontend/src/components/LeftSidebar.tsx b/frontend/src/components/LeftSidebar.tsx
index 1df63fe..1a111bf 100644
--- a/frontend/src/components/LeftSidebar.tsx
+++ b/frontend/src/components/LeftSidebar.tsx
@@ -191,7 +191,7 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ isOpen, onToggle }) => {
 
   const handleDownload = async (item: FSItem) => {
     if (item.type !== 'file') return;
-    const url = `${import.meta.env.VITE_BACKEND_URL || 'http://localhost:8000'}/api/projects/download?user=test&path=${encodeURIComponent(item.path)}`;
+    const url = `${import.meta.env.VITE_BACKEND_URL || ''}/api/projects/download?user=test&path=${encodeURIComponent(item.path)}`;
     const a = document.createElement('a');
     a.href = url;
     a.download = item.name;
@@ -276,7 +276,7 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ isOpen, onToggle }) => {
   };
 
   const handleDownloadFile = (file: FileMeta) => {
-    const url = `${import.meta.env.VITE_BACKEND_URL || 'http://localhost:8000'}/api/files/download?user=test&file_id=${encodeURIComponent(file.id)}`;
+    const url = `${import.meta.env.VITE_BACKEND_URL || ''}/api/files/download?user=test&file_id=${encodeURIComponent(file.id)}`;
     const a = document.createElement('a');
     a.href = url;
     a.download = file.name;
-- 
cgit v1.2.3

