fix(layout): fix common

This commit is contained in:
2026-03-10 16:55:51 +08:00
parent 933ffbb06f
commit 928f64a5f0
2 changed files with 42 additions and 39 deletions

View File

@@ -40,11 +40,14 @@ export function PathnameRecorder({ menu }: ComponentProps) {
const { updateMenuDefaultRouter } = useAppLayoutStore()
useEffect(() => {
let key = process.env.NEXT_PUBLIC_BASE_PATH
? process.env.NEXT_PUBLIC_BASE_PATH
: `/${sideNavMenu?.url}`
pathname.startsWith(`/${sideNavMenu?.url}`) &&
sideNavMenu?.url &&
`/${sideNavMenu?.url}` !== pathname &&
updateMenuDefaultRouter(
`/${sideNavMenu?.url}`,
key,
queryString
? `${process.env.NEXT_PUBLIC_BASE_PATH}${pathname}?${queryString}`
: `${process.env.NEXT_PUBLIC_BASE_PATH}${pathname}`