From 564096c0632128f88b6b5cbbdbd774cc43c4c59f Mon Sep 17 00:00:00 2001 From: Autumn-27 <53844290+Autumn-27@users.noreply.github.com> Date: Thu, 17 Sep 2026 08:55:04 -0400 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E4=BF=AE=E5=A4=8D=E9=9D=99?= =?UTF-8?q?=E6=80=81=E5=AF=BC=E5=87=BA=E7=89=88=E4=BB=BB=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E4=B8=A2=E5=A4=B1=E5=85=A8=E5=B1=80=E5=A4=B4?= =?UTF-8?q?=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 判断任务详情页的前缀 "/function/tasks/" 在 trailingSlash 静态导出下 会把列表页自身(pathname 为 "/function/tasks/")也匹配进去,导致发布 二进制里的列表页走了 full-bleed 分支,侧边栏折叠、搜索、版本号、主题 与账号入口整条 header 都不渲染;dev 与 mock demo 未开 trailingSlash 故看不出问题。判前缀前先剥掉尾部斜杠。 --- web/src/app/(main)/_components/main-content.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/app/(main)/_components/main-content.tsx b/web/src/app/(main)/_components/main-content.tsx index 3d2afa8..05cba41 100644 --- a/web/src/app/(main)/_components/main-content.tsx +++ b/web/src/app/(main)/_components/main-content.tsx @@ -25,7 +25,10 @@ function isFullBleed(pathname: string) { return pathname; } })(); - return p.startsWith("/function/tasks/"); + // 静态导出开了 trailingSlash,列表页自身的 pathname 是 "/function/tasks/", + // 先去掉尾斜杠再判前缀,否则列表页会被误判成详情页而丢掉全局头部。 + const normalized = p.replace(/\/+$/, ""); + return normalized.startsWith("/function/tasks/"); } export function MainContent({ children }: { children: ReactNode }) {