Commit ff445e1b authored by chenshouchao's avatar chenshouchao

feat: // 在产品页面下且未选择产品时 直接跳转home页面

parent 21a0273d
......@@ -9,7 +9,7 @@
import { Box, List } from "@mui/material";
import CurrentProject from "../Project/components/CurrentProject";
import React from "react";
import { Outlet, useNavigate } from "react-router-dom";
import { Outlet, useNavigate, useLocation } from "react-router-dom";
import style from "./index.module.css";
import { observer } from "mobx-react-lite";
import { useStores } from "@/store/index";
......@@ -23,9 +23,10 @@ const MenuLayout = observer(() => {
const navigate = useNavigate();
const productInfo = toJS(currentProjectStore.currentProductInfo);
const location = useLocation();
// 未选择产品时 直接跳转home页面
if (!productInfo.name) {
// 在产品页面下且未选择产品时 直接跳转home页面
if (!productInfo.name && location.pathname.slice(0, 8) === "/product") {
navigate("/home");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment