diff --git a/src/pages/init/index.tsx b/src/pages/init/index.tsx index 91ab458..bb861b6 100644 --- a/src/pages/init/index.tsx +++ b/src/pages/init/index.tsx @@ -2,7 +2,8 @@ import { useDispatch } from "react-redux"; import { Outlet } from "react-router-dom"; import styles from "./index.module.scss"; import { saveConfigAction } from "../../store/system/systemConfigSlice"; -import { Header } from "../../compenents"; +import { Header, NoHeader } from "../../compenents"; +import { useLocation } from "react-router-dom"; interface Props { config: Map; @@ -11,11 +12,13 @@ interface Props { export const InitPage = (props: Props) => { const dispatch = useDispatch(); dispatch(saveConfigAction(props.config)); + const pathname = useLocation().pathname; return ( <>
-
+ {pathname === "/login" && } + {pathname !== "/login" &&
}
diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index e9c7fc0..07133c9 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -7,7 +7,7 @@ import { useNavigate } from "react-router-dom"; import { loginAction, logoutAction } from "../../store/user/loginUserSlice"; import { login, system, user } from "../../api/index"; import { setToken } from "../../utils/index"; -import { Footer, NoHeader } from "../../compenents"; +import { Footer } from "../../compenents"; const LoginPage: React.FC = () => { const dispatch = useDispatch(); @@ -89,7 +89,6 @@ const LoginPage: React.FC = () => { return (
-
学员登录