add webuser API
Change-Id: I525da55355631991fd9554346b539c1c09593113
diff --git a/front/src/TorrentDetailPage.js b/front/src/TorrentDetailPage.js
index 8d3ee43..cc2dd24 100644
--- a/front/src/TorrentDetailPage.js
+++ b/front/src/TorrentDetailPage.js
@@ -1,6 +1,7 @@
import React from 'react';
import { useParams } from 'react-router-dom';
import './App.css';
+import { API_BASE_URL } from "./config";
export default function TorrentDetailPage() {
const { torrentId } = useParams();
@@ -13,7 +14,7 @@
const handleClick = () => {
// 构造下载 URL,包含 userId 和 torrentId 参数
console.log(torrentId)
- const downloadUrl = `http://192.168.5.9:8080/api/get-torrent?userId=${encodeURIComponent(userId)}&torrentId=${encodeURIComponent(torrentId)}`;
+ const downloadUrl = `${API_BASE_URL}/api/get-torrent?userId=${encodeURIComponent(userId)}&torrentId=${encodeURIComponent(torrentId)}`;
// 发起 GET 请求下载文件
fetch(downloadUrl)
@@ -43,7 +44,7 @@
React.useEffect(() => {
setLoading(true);
setError(null);
- fetch(`http://192.168.5.9:8080/api/torrent-detail?id=${encodeURIComponent(torrentId)}`)
+ fetch(`${API_BASE_URL}/api/torrent-detail?id=${encodeURIComponent(torrentId)}`)
.then(res => {
if (!res.ok) throw new Error('网络错误');
return res.json();