From 45137c2f4fad02dd14b19d0baeaf0b2b05d6f2a9 Mon Sep 17 00:00:00 2001 From: bwstudio Date: Thu, 11 Jun 2026 20:53:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=A6=E6=83=85=E9=A1=B5=E3=80=8C?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=A6=96=E9=A1=B5=E3=80=8D=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E3=80=8C=E8=BF=94=E5=9B=9E=E3=80=8D=EF=BC=8C=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E5=89=8D=E9=A1=B5=E7=AD=9B=E9=80=89/=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 router.back() 返回上一页,保留 URL 参数(分类筛选、页码等) - 无历史记录时兜底跳转首页 - 图标改为 🔙 --- web/src/views/detail/index.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web/src/views/detail/index.vue b/web/src/views/detail/index.vue index 07ceb0f..137a82f 100644 --- a/web/src/views/detail/index.vue +++ b/web/src/views/detail/index.vue @@ -35,8 +35,8 @@ - @@ -117,6 +117,15 @@ const doDislike = async () => { } } +const goBack = () => { + // 优先返回上一页(保留筛选/分页状态),无历史则回首页 + if (window.history.length > 1) { + router.back() + } else { + router.push('/') + } +} + const handleNext = async () => { try { const res = await getJokes({ page: 1, page_size: 50 })