fix: bug修复

This commit is contained in:
landaiqing
2024-07-22 22:44:09 +08:00
parent ac41e00105
commit 8e10d4a253
4 changed files with 9 additions and 8 deletions

View File

@@ -12,13 +12,14 @@ export default function AuthRoute(props: { children: React.ReactNode }) {
const condition: boolean =
(currentPath === "/login" && !isLogin) ||
currentPath === "/404" ||
(currentPath === "register" && !isLogin) ||
(currentPath === "forget" && !isLogin);
(currentPath === "/register" && !isLogin) ||
(currentPath === "/forget" && !isLogin) ||
(currentPath === "/" && !isLogin);
// 登录后访问login
const conditionWithLogin: boolean =
(currentPath === "/login" && isLogin) ||
(currentPath === "register" && isLogin) ||
(currentPath === "forget" && isLogin);
(currentPath === "/register" && isLogin) ||
(currentPath === "/forget" && isLogin);
const findPath: any = matchAuth(currentPath);
if (condition) {