mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-08 15:40:51 +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 { Outlet } from "react-router-dom";
|
||||||
import styles from "./index.module.scss";
|
import styles from "./index.module.scss";
|
||||||
import { saveConfigAction } from "../../store/system/systemConfigSlice";
|
import { saveConfigAction } from "../../store/system/systemConfigSlice";
|
||||||
import { Header } from "../../compenents";
|
import { Header, NoHeader } from "../../compenents";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
config: Map<string, string>;
|
config: Map<string, string>;
|
||||||
@ -11,11 +12,13 @@ interface Props {
|
|||||||
export const InitPage = (props: Props) => {
|
export const InitPage = (props: Props) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
dispatch(saveConfigAction(props.config));
|
dispatch(saveConfigAction(props.config));
|
||||||
|
const pathname = useLocation().pathname;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<Header></Header>
|
{pathname === "/login" && <NoHeader></NoHeader>}
|
||||||
|
{pathname !== "/login" && <Header></Header>}
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
@ -7,7 +7,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { loginAction, logoutAction } from "../../store/user/loginUserSlice";
|
import { loginAction, logoutAction } from "../../store/user/loginUserSlice";
|
||||||
import { login, system, user } from "../../api/index";
|
import { login, system, user } from "../../api/index";
|
||||||
import { setToken } from "../../utils/index";
|
import { setToken } from "../../utils/index";
|
||||||
import { Footer, NoHeader } from "../../compenents";
|
import { Footer } from "../../compenents";
|
||||||
|
|
||||||
const LoginPage: React.FC = () => {
|
const LoginPage: React.FC = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@ -89,7 +89,6 @@ const LoginPage: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<div className={styles["login-content"]}>
|
<div className={styles["login-content"]}>
|
||||||
<div className={styles["top-content"]}>
|
<div className={styles["top-content"]}>
|
||||||
<NoHeader></NoHeader>
|
|
||||||
<div className={styles["title"]}>学员登录</div>
|
<div className={styles["title"]}>学员登录</div>
|
||||||
<div className={styles["login-box"]}>
|
<div className={styles["login-box"]}>
|
||||||
<div className={styles["left-box"]}>
|
<div className={styles["left-box"]}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user