种子详情-初步

Change-Id: I20b9846484c3976b6043773943f12d847df873f6
diff --git a/src/views/torrent/TorrentDetailView.vue b/src/views/torrent/TorrentDetailView.vue
index c3c367e..a79a528 100644
--- a/src/views/torrent/TorrentDetailView.vue
+++ b/src/views/torrent/TorrentDetailView.vue
@@ -299,6 +299,19 @@
 

 export default {

   name: 'TorrentDetailView',

+  components: {

+    ArrowLeft,

+    Download,

+    Star,

+    Flag,

+    User,

+    Clock,

+    Document,

+    Files,

+    Picture,

+    Folder,

+    Like

+  },

   setup() {

     const route = useRoute()

     const router = useRouter()

@@ -345,7 +358,7 @@
     })

     

     onMounted(() => {

-      const infoHash = route.params.infoHash || route.params.id

+      const infoHash = route.params.infoHash

       if (infoHash) {

         fetchTorrentDetail(infoHash)

       } else {

@@ -359,7 +372,7 @@
         loading.value = true

         

         // 获取种子详情

-        const response = await axios.get(`http://localhost:8081/api/torrent/view/${infoHash}`)

+        const response = await axios.get(`/api/torrent/view/${infoHash}`)

         

         if (response.data.code === 0) {

           torrentInfo.value = response.data

@@ -482,13 +495,13 @@
     }

     

     const handleDownload = async () => {

-      if (!torrentInfo.value) return

+      if (!torrentInfo.value?.infoHash) return

       

       downloading.value = true

       try {

-        // 这里应该调用下载种子文件的API

+        // 调用下载种子文件的API

         const response = await axios.get(

-          `http://localhost:8081/api/torrent/download/${torrentInfo.value.infoHash}`,

+          `/api/torrent/download/${torrentInfo.value.infoHash}`,

           { responseType: 'blob' }

         )

         

@@ -580,7 +593,7 @@
     }

     

     const retry = () => {

-      const infoHash = route.params.infoHash || route.params.id

+      const infoHash = route.params.infoHash

       if (infoHash) {

         fetchTorrentDetail(infoHash)

       }