mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-12-23 20:30:18 +08:00
登录,首页使用不同顶部
This commit is contained in:
@@ -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<string, string>;
|
||||
@@ -11,11 +12,13 @@ interface Props {
|
||||
export const InitPage = (props: Props) => {
|
||||
const dispatch = useDispatch();
|
||||
dispatch(saveConfigAction(props.config));
|
||||
const pathname = useLocation().pathname;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<Header></Header>
|
||||
{pathname === "/login" && <NoHeader></NoHeader>}
|
||||
{pathname !== "/login" && <Header></Header>}
|
||||
<Outlet />
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user