summaryrefslogtreecommitdiff
path: root/frontend/src/components/LeftSidebar.tsx
diff options
context:
space:
mode:
authorblackhao <13851610112@163.com>2025-12-10 21:07:17 -0600
committerblackhao <13851610112@163.com>2025-12-10 21:07:17 -0600
commit478100200dff8400a6e47502fa4a6db035fd6532 (patch)
treea9936debc43dc52323ed3f2c7dccca09959d2a81 /frontend/src/components/LeftSidebar.tsx
parent9646da833bc3d94564c10649b62a378d0190471e (diff)
fix: use relative API paths for production deployment
Diffstat (limited to 'frontend/src/components/LeftSidebar.tsx')
-rw-r--r--frontend/src/components/LeftSidebar.tsx4
1 files changed, 2 insertions, 2 deletions
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;