mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-08 10:54:12 +08:00
登录,首页使用不同顶部
This commit is contained in:
parent
3d38212ed9
commit
42f545e68b
@ -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>
|
||||
</>
|
||||
|
@ -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 (
|
||||
<div className={styles["login-content"]}>
|
||||
<div className={styles["top-content"]}>
|
||||
<NoHeader></NoHeader>
|
||||
<div className={styles["title"]}>学员登录</div>
|
||||
<div className={styles["login-box"]}>
|
||||
<div className={styles["left-box"]}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user