Optimize code

This commit is contained in:
2023-12-27 10:06:43 +08:00
parent 647b203b6a
commit 4eec5092ff
3 changed files with 16 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ const AuthRoute = () => {
return <Navigate to={'/verify'} />
}
}
if (isLogin && lastMatch.pathname === '/login') {
if (isLogin && ['/login', '/forget'].includes(lastMatch.pathname)) {
return <Navigate to={'/'} />
}