Optimize router

This commit is contained in:
2023-11-30 18:36:43 +08:00
parent f595cb380a
commit d9e1cbcfa3
10 changed files with 113 additions and 85 deletions

View File

@@ -22,8 +22,13 @@ const AuthRoute = () => {
)
}
if (isLogin && lastMatch.pathname === '/login') {
return <Navigate to="/" />
return <Navigate to={'/'} />
}
if (location.pathname.length > 1 && location.pathname.endsWith('/')) {
return <Navigate to={location.pathname.substring(0, location.pathname.length - 1)} />
}
return outlet
}, [
handle?.title,