|
@@ -8,7 +8,7 @@ import SubScreen from "@components/SubScreen";
|
|
|
import RouteContainer from "@layout/Routes/RouteContainer";
|
|
import RouteContainer from "@layout/Routes/RouteContainer";
|
|
|
import {Navigate} from "react-router";
|
|
import {Navigate} from "react-router";
|
|
|
import usePreviousRoute from "@hooks/usePreviousRoute";
|
|
import usePreviousRoute from "@hooks/usePreviousRoute";
|
|
|
-import {ROUTE_PATH} from "@constants/routes";
|
|
|
|
|
|
|
+import {ROUTE_PATH, ROUTE_TYPE_POP_OR_FULL} from "@constants/routes";
|
|
|
import {useThemeProvider} from "@contexts/themeContext";
|
|
import {useThemeProvider} from "@contexts/themeContext";
|
|
|
import useAuthLockRoute from "@hooks/useAuthLockRoute";
|
|
import useAuthLockRoute from "@hooks/useAuthLockRoute";
|
|
|
const RouteWrapper = lazy(() => import('@layout/Routes/RouteWrapper'));
|
|
const RouteWrapper = lazy(() => import('@layout/Routes/RouteWrapper'));
|
|
@@ -69,6 +69,7 @@ const CHashRouter=(props)=>{
|
|
|
hashs.shift();
|
|
hashs.shift();
|
|
|
let currpath=pathname+hash;
|
|
let currpath=pathname+hash;
|
|
|
let currhash="";
|
|
let currhash="";
|
|
|
|
|
+ let subIndex=-1;
|
|
|
// const timeout=500;
|
|
// const timeout=500;
|
|
|
//多hash 切到最后一个
|
|
//多hash 切到最后一个
|
|
|
const getRoutes=(path)=>{
|
|
const getRoutes=(path)=>{
|
|
@@ -111,9 +112,10 @@ const CHashRouter=(props)=>{
|
|
|
// return (<Navigate to={pathname+currhash} replace={true}/>)
|
|
// return (<Navigate to={pathname+currhash} replace={true}/>)
|
|
|
}
|
|
}
|
|
|
currhash+=hash;
|
|
currhash+=hash;
|
|
|
|
|
+ if (route.type===ROUTE_TYPE_POP_OR_FULL)subIndex++;
|
|
|
return (
|
|
return (
|
|
|
// <CSSTransition timeout={timeout}>
|
|
// <CSSTransition timeout={timeout}>
|
|
|
- <RouteContainer level={index} route={route} onClose={handleClose} header={Header[route.component]}>
|
|
|
|
|
|
|
+ <RouteContainer level={subIndex} route={route} onClose={handleClose} header={Header[route.component]}>
|
|
|
<Suspense fallback={<SmallLoading/>}>
|
|
<Suspense fallback={<SmallLoading/>}>
|
|
|
<Routes key={index} location={{pathname:currpath,hash:hash,search}}>
|
|
<Routes key={index} location={{pathname:currpath,hash:hash,search}}>
|
|
|
{
|
|
{
|