From d44111320b6038e6f1c0d71de41767a2ad63b949 Mon Sep 17 00:00:00 2001 From: kjqwer <2990346238@qq.com> Date: Mon, 8 Sep 2025 07:31:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=9C=E5=93=81=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E9=A1=B5=E9=9D=A2=E4=B8=8D=E5=88=B7=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +- backend/config/watchlist.json | 502 ---------------------------------- ui/src/views/ArtistView.vue | 63 ++++- 3 files changed, 56 insertions(+), 513 deletions(-) delete mode 100644 backend/config/watchlist.json diff --git a/.gitignore b/.gitignore index dd01f40..0b02968 100644 --- a/.gitignore +++ b/.gitignore @@ -64,8 +64,10 @@ typings/ downloads/ data/ -# 用户配置文件(每个用户不同) +# 用户配置文件 backend/config/user-config.json +# 待看名单 +backend/config/watchlist.json # 自己的启动文件 start_me.bat diff --git a/backend/config/watchlist.json b/backend/config/watchlist.json deleted file mode 100644 index e8cbee2..0000000 --- a/backend/config/watchlist.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "items": [ - { - "id": "1757123801822", - "url": "http://localhost:3001/artist/103047332", - "title": "作者管理", - "createdAt": "2025-09-06T01:56:41.822Z", - "updatedAt": "2025-09-06T01:56:41.822Z" - }, - { - "id": "1757124092574", - "url": "http://localhost:3001/artist/113088709", - "title": "作者 113088709", - "createdAt": "2025-09-06T02:01:32.574Z", - "updatedAt": "2025-09-06T02:01:32.574Z" - }, - { - "id": "1757124092579", - "url": "http://localhost:3001/artist/116491647", - "title": "作者 116491647", - "createdAt": "2025-09-06T02:01:32.579Z", - "updatedAt": "2025-09-06T02:01:32.579Z" - }, - { - "id": "1757124092583", - "url": "http://localhost:3001/artist/20002274", - "title": "作者 20002274", - "createdAt": "2025-09-06T02:01:32.583Z", - "updatedAt": "2025-09-06T02:01:32.583Z" - }, - { - "id": "1757124092586", - "url": "http://localhost:3001/artist/102068964", - "title": "作者 102068964", - "createdAt": "2025-09-06T02:01:32.586Z", - "updatedAt": "2025-09-06T02:01:32.586Z" - }, - { - "id": "1757124092589", - "url": "http://localhost:3001/artist/57881733", - "title": "作者 57881733", - "createdAt": "2025-09-06T02:01:32.589Z", - "updatedAt": "2025-09-06T02:01:32.589Z" - }, - { - "id": "1757124092595", - "url": "http://localhost:3001/artist/106498479", - "title": "作者 106498479", - "createdAt": "2025-09-06T02:01:32.595Z", - "updatedAt": "2025-09-06T02:01:32.595Z" - }, - { - "id": "1757124092598", - "url": "http://localhost:3001/artist/87347255?page=21", - "title": "作者 87347255 - 第21页", - "createdAt": "2025-09-06T02:01:32.598Z", - "updatedAt": "2025-09-06T02:01:32.598Z" - }, - { - "id": "1757124092601", - "url": "http://localhost:3001/artist/112391670", - "title": "作者 112391670", - "createdAt": "2025-09-06T02:01:32.601Z", - "updatedAt": "2025-09-06T02:01:32.601Z" - }, - { - "id": "1757124092605", - "url": "http://localhost:3001/artist/97349140", - "title": "作者 97349140", - "createdAt": "2025-09-06T02:01:32.605Z", - "updatedAt": "2025-09-06T02:01:32.605Z" - }, - { - "id": "1757124092608", - "url": "http://localhost:3001/artist/32222272", - "title": "作者 32222272", - "createdAt": "2025-09-06T02:01:32.608Z", - "updatedAt": "2025-09-06T02:01:32.608Z" - }, - { - "id": "1757124092612", - "url": "http://localhost:3001/artist/16315304", - "title": "作者 16315304", - "createdAt": "2025-09-06T02:01:32.612Z", - "updatedAt": "2025-09-06T02:01:32.612Z" - }, - { - "id": "1757124092615", - "url": "http://localhost:3001/artist/20420220", - "title": "作者 20420220", - "createdAt": "2025-09-06T02:01:32.615Z", - "updatedAt": "2025-09-06T02:01:32.615Z" - }, - { - "id": "1757124092619", - "url": "http://localhost:3001/artist/95485582", - "title": "作者 95485582", - "createdAt": "2025-09-06T02:01:32.619Z", - "updatedAt": "2025-09-06T02:01:32.619Z" - }, - { - "id": "1757124092622", - "url": "http://localhost:3001/artwork/99046180", - "title": "作品 99046180", - "createdAt": "2025-09-06T02:01:32.622Z", - "updatedAt": "2025-09-06T02:01:32.622Z" - }, - { - "id": "1757124092625", - "url": "http://localhost:3001/artist/92969522", - "title": "作者 92969522", - "createdAt": "2025-09-06T02:01:32.625Z", - "updatedAt": "2025-09-06T02:01:32.625Z" - }, - { - "id": "1757124092629", - "url": "http://localhost:3001/artist/35790899", - "title": "作者 35790899", - "createdAt": "2025-09-06T02:01:32.629Z", - "updatedAt": "2025-09-06T02:01:32.629Z" - }, - { - "id": "1757124092632", - "url": "http://localhost:3001/artist/115689478?page=11", - "title": "作者 115689478 - 第11页", - "createdAt": "2025-09-06T02:01:32.632Z", - "updatedAt": "2025-09-06T02:01:32.632Z" - }, - { - "id": "1757124092635", - "url": "http://localhost:3001/artist/54082094", - "title": "作者 54082094", - "createdAt": "2025-09-06T02:01:32.635Z", - "updatedAt": "2025-09-06T02:01:32.635Z" - }, - { - "id": "1757124092639", - "url": "http://localhost:3001/artist/113605557", - "title": "作者 113605557", - "createdAt": "2025-09-06T02:01:32.639Z", - "updatedAt": "2025-09-06T02:01:32.639Z" - }, - { - "id": "1757124092642", - "url": "http://localhost:3001/artist/12288015", - "title": "作者 12288015", - "createdAt": "2025-09-06T02:01:32.642Z", - "updatedAt": "2025-09-06T02:01:32.642Z" - }, - { - "id": "1757124092646", - "url": "http://localhost:3001/artist/107444384", - "title": "作者 107444384", - "createdAt": "2025-09-06T02:01:32.646Z", - "updatedAt": "2025-09-06T02:01:32.646Z" - }, - { - "id": "1757124092649", - "url": "http://localhost:3001/artist/98929998", - "title": "作者 98929998", - "createdAt": "2025-09-06T02:01:32.649Z", - "updatedAt": "2025-09-06T02:01:32.649Z" - }, - { - "id": "1757124092653", - "url": "http://localhost:3001/artist/35227306", - "title": "作者 35227306", - "createdAt": "2025-09-06T02:01:32.653Z", - "updatedAt": "2025-09-06T02:01:32.653Z" - }, - { - "id": "1757124092656", - "url": "http://localhost:3001/artist/55914620", - "title": "作者 55914620", - "createdAt": "2025-09-06T02:01:32.656Z", - "updatedAt": "2025-09-06T02:01:32.656Z" - }, - { - "id": "1757124092662", - "url": "http://localhost:3001/artist/112826987", - "title": "作者 112826987", - "createdAt": "2025-09-06T02:01:32.662Z", - "updatedAt": "2025-09-06T02:01:32.662Z" - }, - { - "id": "1757124092665", - "url": "http://localhost:3001/artist/117505514", - "title": "作者 117505514", - "createdAt": "2025-09-06T02:01:32.665Z", - "updatedAt": "2025-09-06T02:01:32.665Z" - }, - { - "id": "1757124092669", - "url": "http://localhost:3001/artist/116034471?page=11", - "title": "作者 116034471 - 第11页", - "createdAt": "2025-09-06T02:01:32.669Z", - "updatedAt": "2025-09-06T02:01:32.669Z" - }, - { - "id": "1757124092672", - "url": "http://localhost:3001/artist/116826562", - "title": "作者 116826562", - "createdAt": "2025-09-06T02:01:32.672Z", - "updatedAt": "2025-09-06T02:01:32.672Z" - }, - { - "id": "1757124092675", - "url": "http://localhost:3001/artist/119419938", - "title": "作者 119419938", - "createdAt": "2025-09-06T02:01:32.675Z", - "updatedAt": "2025-09-06T02:01:32.675Z" - }, - { - "id": "1757124092679", - "url": "http://localhost:3001/artist/105818043", - "title": "作者 105818043", - "createdAt": "2025-09-06T02:01:32.679Z", - "updatedAt": "2025-09-06T02:01:32.679Z" - }, - { - "id": "1757124092683", - "url": "http://localhost:3001/artist/3328617", - "title": "作者 3328617", - "createdAt": "2025-09-06T02:01:32.683Z", - "updatedAt": "2025-09-06T02:01:32.683Z" - }, - { - "id": "1757124092686", - "url": "http://localhost:3001/artist/114508563", - "title": "作者 114508563", - "createdAt": "2025-09-06T02:01:32.686Z", - "updatedAt": "2025-09-06T02:01:32.686Z" - }, - { - "id": "1757124092689", - "url": "http://localhost:3001/artist/48447420", - "title": "作者 48447420", - "createdAt": "2025-09-06T02:01:32.689Z", - "updatedAt": "2025-09-06T02:01:32.689Z" - }, - { - "id": "1757124092696", - "url": "http://localhost:3001/artist/18898196", - "title": "作者 18898196", - "createdAt": "2025-09-06T02:01:32.696Z", - "updatedAt": "2025-09-06T02:01:32.696Z" - }, - { - "id": "1757124092699", - "url": "http://localhost:3001/artist/24503943", - "title": "作者 24503943", - "createdAt": "2025-09-06T02:01:32.699Z", - "updatedAt": "2025-09-06T02:01:32.699Z" - }, - { - "id": "1757124092703", - "url": "http://localhost:3001/artist/83735825", - "title": "作者 83735825", - "createdAt": "2025-09-06T02:01:32.703Z", - "updatedAt": "2025-09-06T02:01:32.703Z" - }, - { - "id": "1757124092706", - "url": "http://localhost:3001/artist/109989392", - "title": "作者 109989392", - "createdAt": "2025-09-06T02:01:32.706Z", - "updatedAt": "2025-09-06T02:01:32.706Z" - }, - { - "id": "1757124092712", - "url": "http://localhost:3001/artist/119068816", - "title": "作者 119068816", - "createdAt": "2025-09-06T02:01:32.712Z", - "updatedAt": "2025-09-06T02:01:32.712Z" - }, - { - "id": "1757124092718", - "url": "http://localhost:3001/artist/8934406", - "title": "作者 8934406", - "createdAt": "2025-09-06T02:01:32.718Z", - "updatedAt": "2025-09-06T02:01:32.718Z" - }, - { - "id": "1757124092725", - "url": "http://localhost:3001/artist/118710458", - "title": "作者 118710458", - "createdAt": "2025-09-06T02:01:32.725Z", - "updatedAt": "2025-09-06T02:01:32.725Z" - }, - { - "id": "1757124092733", - "url": "http://localhost:3001/artist/111705416", - "title": "作者 111705416", - "createdAt": "2025-09-06T02:01:32.733Z", - "updatedAt": "2025-09-06T02:01:32.733Z" - }, - { - "id": "1757124092737", - "url": "http://localhost:3001/artist/114537113", - "title": "作者 114537113", - "createdAt": "2025-09-06T02:01:32.737Z", - "updatedAt": "2025-09-06T02:01:32.737Z" - }, - { - "id": "1757124092741", - "url": "http://localhost:3001/artist/117665623", - "title": "作者 117665623", - "createdAt": "2025-09-06T02:01:32.741Z", - "updatedAt": "2025-09-06T02:01:32.741Z" - }, - { - "id": "1757124092745", - "url": "http://localhost:3001/artist/17745716", - "title": "作者 17745716", - "createdAt": "2025-09-06T02:01:32.745Z", - "updatedAt": "2025-09-06T02:01:32.745Z" - }, - { - "id": "1757124092749", - "url": "http://localhost:3001/artist/113801960", - "title": "作者 113801960", - "createdAt": "2025-09-06T02:01:32.749Z", - "updatedAt": "2025-09-06T02:01:32.749Z" - }, - { - "id": "1757124092752", - "url": "http://localhost:3001/artist/116034471", - "title": "作者 116034471", - "createdAt": "2025-09-06T02:01:32.752Z", - "updatedAt": "2025-09-06T02:01:32.752Z" - }, - { - "id": "1757124092756", - "url": "http://localhost:3001/artist/117814316", - "title": "作者 117814316", - "createdAt": "2025-09-06T02:01:32.756Z", - "updatedAt": "2025-09-06T02:01:32.756Z" - }, - { - "id": "1757134816467", - "url": "http://localhost:3001/artist/36412673", - "title": "作者 36412673", - "createdAt": "2025-09-06T05:00:16.467Z", - "updatedAt": "2025-09-06T05:00:16.467Z" - }, - { - "id": "1757134847809", - "url": "http://localhost:3001/artist/8786609", - "title": "作者 8786609", - "createdAt": "2025-09-06T05:00:47.809Z", - "updatedAt": "2025-09-06T05:00:47.809Z" - }, - { - "id": "1757134866111", - "url": "http://localhost:3001/artist/105728977", - "title": "作者 105728977", - "createdAt": "2025-09-06T05:01:06.111Z", - "updatedAt": "2025-09-06T05:01:06.111Z" - }, - { - "id": "1757134884090", - "url": "http://localhost:3001/artist/52918150", - "title": "作者 52918150", - "createdAt": "2025-09-06T05:01:24.090Z", - "updatedAt": "2025-09-06T05:01:24.090Z" - }, - { - "id": "1757134945366", - "url": "http://localhost:3001/artist/30947069", - "title": "作者 30947069", - "createdAt": "2025-09-06T05:02:25.366Z", - "updatedAt": "2025-09-06T05:02:25.366Z" - }, - { - "id": "1757134976212", - "url": "http://localhost:3001/artist/104459830", - "title": "作者 104459830", - "createdAt": "2025-09-06T05:02:56.212Z", - "updatedAt": "2025-09-06T05:02:56.212Z" - }, - { - "id": "1757135192806", - "url": "http://localhost:3001/artist/115568000", - "title": "作者 115568000", - "createdAt": "2025-09-06T05:06:32.806Z", - "updatedAt": "2025-09-06T05:06:32.806Z" - }, - { - "id": "1757148264563", - "url": "http://localhost:3001/artist/109433637", - "title": "作者 109433637", - "createdAt": "2025-09-06T08:44:24.563Z", - "updatedAt": "2025-09-06T08:44:24.563Z" - }, - { - "id": "1757148286939", - "url": "http://localhost:3001/artist/89469319", - "title": "作者 89469319", - "createdAt": "2025-09-06T08:44:46.939Z", - "updatedAt": "2025-09-06T08:44:46.939Z" - }, - { - "id": "1757148309527", - "url": "http://localhost:3001/artist/43570725", - "title": "作者 43570725", - "createdAt": "2025-09-06T08:45:09.527Z", - "updatedAt": "2025-09-06T08:45:09.527Z" - }, - { - "id": "1757148337732", - "url": "http://localhost:3001/artwork/134605714?artistId=114157922&artworkType=art&page=1&returnUrl=/artist/114157922&scrollTop=0", - "title": "作品 134605714 - 第1页", - "createdAt": "2025-09-06T08:45:37.732Z", - "updatedAt": "2025-09-06T08:45:37.732Z" - }, - { - "id": "1757148416536", - "url": "http://localhost:3001/artist/75353169", - "title": "作者 75353169", - "createdAt": "2025-09-06T08:46:56.536Z", - "updatedAt": "2025-09-06T08:46:56.536Z" - }, - { - "id": "1757148514536", - "url": "http://localhost:3001/artist/109989392?page=1", - "title": "作者 109989392 - 第1页", - "createdAt": "2025-09-06T08:48:34.536Z", - "updatedAt": "2025-09-06T08:48:34.536Z" - }, - { - "id": "1757148606603", - "url": "http://localhost:3001/artist/24076060", - "title": "作者 24076060", - "createdAt": "2025-09-06T08:50:06.603Z", - "updatedAt": "2025-09-06T08:50:06.603Z" - }, - { - "id": "1757148650070", - "url": "http://localhost:3001/artist/116180859", - "title": "作者 116180859", - "createdAt": "2025-09-06T08:50:50.070Z", - "updatedAt": "2025-09-06T08:50:50.070Z" - }, - { - "id": "1757148777962", - "url": "http://localhost:3001/artist/40589862", - "title": "作者 40589862", - "createdAt": "2025-09-06T08:52:57.962Z", - "updatedAt": "2025-09-06T08:52:57.962Z" - }, - { - "id": "1757148803009", - "url": "http://localhost:3001/artist/115384269", - "title": "作者 115384269", - "createdAt": "2025-09-06T08:53:23.009Z", - "updatedAt": "2025-09-06T08:53:23.009Z" - }, - { - "id": "1757148855942", - "url": "http://localhost:3001/artist/71278415", - "title": "作者 71278415", - "createdAt": "2025-09-06T08:54:15.942Z", - "updatedAt": "2025-09-06T08:54:15.942Z" - }, - { - "id": "1757148913189", - "url": "http://localhost:3001/artist/93761289", - "title": "作者 93761289", - "createdAt": "2025-09-06T08:55:13.189Z", - "updatedAt": "2025-09-06T08:55:13.189Z" - }, - { - "id": "1757148929478", - "url": "http://localhost:3001/artist/116549618", - "title": "作者 116549618", - "createdAt": "2025-09-06T08:55:29.478Z", - "updatedAt": "2025-09-06T08:55:29.478Z" - }, - { - "id": "1757148987777", - "url": "http://localhost:3001/artist/119034168?page=1", - "title": "作者 119034168 - 第1页", - "createdAt": "2025-09-06T08:56:27.777Z", - "updatedAt": "2025-09-06T08:56:27.777Z" - }, - { - "id": "1757149119048", - "url": "http://localhost:3001/artist/3969934?page=1", - "title": "作者 3969934 - 第1页", - "createdAt": "2025-09-06T08:58:39.048Z", - "updatedAt": "2025-09-06T08:58:39.048Z" - }, - { - "id": "1757149171042", - "url": "http://localhost:3001/artist/9631509", - "title": "作者 9631509", - "createdAt": "2025-09-06T08:59:31.042Z", - "updatedAt": "2025-09-06T08:59:31.043Z" - } - ], - "lastUpdated": "2025-09-07T09:03:59.197Z" -} \ No newline at end of file diff --git a/ui/src/views/ArtistView.vue b/ui/src/views/ArtistView.vue index 1bf80fc..3592ed8 100644 --- a/ui/src/views/ArtistView.vue +++ b/ui/src/views/ArtistView.vue @@ -439,7 +439,7 @@ const goToPage = (page: number) => { } }); - fetchArtworks(page); + // 由于路由监听器会自动处理页面变化,这里不需要手动调用fetchArtworks }; // 关注/取消关注 @@ -559,11 +559,10 @@ const handleJumpToPage = async () => { } }); - try { - await fetchArtworks(page, true); - } finally { + // 等待页面变化处理完成 + setTimeout(() => { jumping.value = false; - } + }, 500); }; // 监听路由变化 @@ -594,13 +593,45 @@ watch(() => route.params.id, async (newId, oldId) => { } }, { immediate: false }); +// 防止重复处理的标志 +const isProcessingPageChange = ref(false); + +// 统一的页面变化处理函数 +const handlePageChange = async (page: number, isJumpToPage = false) => { + if (isProcessingPageChange.value || page === currentPage.value) return; + + isProcessingPageChange.value = true; + try { + // 如果artist还没加载完成,等待加载完成 + if (!artist.value) { + const waitForArtist = () => { + return new Promise((resolve) => { + const unwatch = watch(() => artist.value, (newArtist) => { + if (newArtist) { + unwatch(); + resolve(); + } + }, { immediate: true }); + }); + }; + await waitForArtist(); + } + + if (artist.value) { + currentPage.value = page; + await fetchArtworks(page, isJumpToPage); + } + } finally { + isProcessingPageChange.value = false; + } +}; + // 监听URL查询参数变化 -watch(() => route.query.page, (newPage) => { +watch(() => route.query.page, async (newPage) => { if (newPage && artist.value) { const page = parseInt(newPage as string); - if (page > 0 && page !== currentPage.value) { - currentPage.value = page; - fetchArtworks(page, true); + if (page > 0) { + await handlePageChange(page, true); } } }); @@ -612,7 +643,19 @@ watch(() => artist.value?.id, (newArtistId, oldArtistId) => { artworks.value = []; currentPage.value = 1; totalPages.value = 0; - fetchArtworks(1); + + // 检查是否有页面参数 + const pageParam = route.query.page; + if (pageParam) { + const page = parseInt(pageParam as string); + if (page > 0) { + handlePageChange(page, true); + } else { + fetchArtworks(1); + } + } else { + fetchArtworks(1); + } } }, { immediate: false });