From 7da9f53043d4932a21910fa247f60653667696b4 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 21 Jul 2023 11:12:18 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=90=9C=E7=B4=A2=E6=9C=AA=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E7=B1=BB=E5=9E=8B=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/MediaCard.vue | 18 +- src/pages/resource.vue | 6 +- src/router/index.ts | 8 - src/views/discover/TorrentCardListView.vue | 290 +++++++++++---------- 4 files changed, 161 insertions(+), 161 deletions(-) diff --git a/src/components/cards/MediaCard.vue b/src/components/cards/MediaCard.vue index 3a00a775..7bd8b7f7 100644 --- a/src/components/cards/MediaCard.vue +++ b/src/components/cards/MediaCard.vue @@ -323,13 +323,17 @@ const openDetailWindow = () => { // 开始搜索 const handleSearch = () => { - router.push( - `/resource/${ - props.media?.tmdb_id - ? `tmdb:${props.media?.tmdb_id}` - : `douban:${props.media?.douban_id}` - }` - ); + router.push({ + path: "/resource", + query: { + keyword: `${ + props.media?.tmdb_id + ? `tmdb:${props.media?.tmdb_id}` + : `douban:${props.media?.douban_id}` + }`, + type: props.media?.type, + }, + }); }; // 装载时检查是否已订阅 diff --git a/src/pages/resource.vue b/src/pages/resource.vue index 81313c6d..462ae0df 100644 --- a/src/pages/resource.vue +++ b/src/pages/resource.vue @@ -5,11 +5,13 @@ import TorrentCardListView from "@/views/discover/TorrentCardListView.vue"; const route = useRoute(); // 查询TMDBID或标题 -const keyword = route.params?.keyword?.toString() ?? ""; +const keyword = route.query?.keyword?.toString() ?? ""; +// 查询类型 +const type = route.query?.type?.toString() ?? ""; diff --git a/src/router/index.ts b/src/router/index.ts index 981db989..c83a14a3 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -33,14 +33,6 @@ const router = createRouter({ requiresAuth: true, }, }, - { - path: 'resource/:keyword+', - component: () => import('../pages/resource.vue'), - props: true, - meta: { - requiresAuth: true, - }, - }, { path: 'subscribe-movie', component: () => import('../pages/subscribe-movie.vue'), diff --git a/src/views/discover/TorrentCardListView.vue b/src/views/discover/TorrentCardListView.vue index dcd7524f..4fa85d9d 100644 --- a/src/views/discover/TorrentCardListView.vue +++ b/src/views/discover/TorrentCardListView.vue @@ -1,33 +1,36 @@