Optimize submenu in ToolsFramework. Optimize code

This commit is contained in:
2023-10-12 16:18:24 +08:00
parent bc82572fa8
commit 6a7cae8319
11 changed files with 214 additions and 134 deletions

View File

@@ -16,9 +16,9 @@ const AuthRoute = () => {
if (matches.some(({ handle }) => (handle as RouteHandle)?.auth) && !isLogin) {
return (
<Navigate
to={`/login${
'?redirect=' + encodeURIComponent(lastMatch.pathname + location.search)
}`}
to={`/login?redirect=${encodeURIComponent(
`${lastMatch.pathname}${location.search}`
)}`}
/>
)
}
@@ -27,13 +27,13 @@ const AuthRoute = () => {
}
return outlet
}, [
handle?.auth,
handle?.title,
handle?.titlePostfix,
handle?.titlePrefix,
isLogin,
lastMatch.pathname,
location.search,
matches,
outlet
])
}