|
@@ -24,7 +24,7 @@ const i18n=global.i18n;
|
|
|
const WGame=()=>{
|
|
const WGame=()=>{
|
|
|
const dispatch = useDispatch();
|
|
const dispatch = useDispatch();
|
|
|
const {pathname}=useLocation();
|
|
const {pathname}=useLocation();
|
|
|
- const {gameID} = useThemeProvider();
|
|
|
|
|
|
|
+ const {gameID,preLocation} = useThemeProvider();
|
|
|
// const gameid=pathname.split("/").pop();
|
|
// const gameid=pathname.split("/").pop();
|
|
|
const gameid=gameID;
|
|
const gameid=gameID;
|
|
|
const [openBox,setOpenBox]=useState(false);
|
|
const [openBox,setOpenBox]=useState(false);
|
|
@@ -39,7 +39,17 @@ const WGame=()=>{
|
|
|
const gameCardInfo=useSelector(getGameCardInfo(gameid));
|
|
const gameCardInfo=useSelector(getGameCardInfo(gameid));
|
|
|
const onBack=()=>{
|
|
const onBack=()=>{
|
|
|
// dispatch(reqGameInfo());
|
|
// dispatch(reqGameInfo());
|
|
|
- navigate(ROUTE_PATH.BACK);
|
|
|
|
|
|
|
+ let ppath=ROUTE_PATH.HOME;
|
|
|
|
|
+ if (preLocation!=null){
|
|
|
|
|
+ let pathname=preLocation.pathname;
|
|
|
|
|
+ if (pathname!=null&&pathname!==""){
|
|
|
|
|
+ if (!pathname.startsWith(ROUTE_PATH.GAME)){
|
|
|
|
|
+ ppath=pathname;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // navigate(ROUTE_PATH.BACK);
|
|
|
|
|
+ navigate(ppath,{replace:true});
|
|
|
}
|
|
}
|
|
|
const parseURL=()=>{
|
|
const parseURL=()=>{
|
|
|
let key=LOCAL_GAME_URL+gameid;
|
|
let key=LOCAL_GAME_URL+gameid;
|