From 7f70cb15d035f0c233b9e62b9e43aa985317c908 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 04 十一月 2024 10:22:45 +0800 Subject: [PATCH] # --- zy-acs-flow/src/page/dashboard/Dashboard.jsx | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/zy-acs-flow/src/page/dashboard/Dashboard.jsx b/zy-acs-flow/src/page/dashboard/Dashboard.jsx index 9a5c559..1c9389f 100644 --- a/zy-acs-flow/src/page/dashboard/Dashboard.jsx +++ b/zy-acs-flow/src/page/dashboard/Dashboard.jsx @@ -1,15 +1,21 @@ import React, { useState, useRef, useEffect, useMemo } from "react"; -import { - useCheckAuth, - useTranslate, -} from "react-admin"; +import { useNavigate } from 'react-router-dom'; +import { useAuthProvider } from 'react-admin'; +import MapPage from "../../map/MapPage"; const Dashboard = () => { - const translate = useTranslate(); + const authProvider = useAuthProvider(); + const navigate = useNavigate(); + + useEffect(() => { + authProvider.checkAuth().catch(() => { + navigate('/login'); + }); + }, [authProvider, navigate]); return ( <> - <h1>{translate('hello')}</h1> + <MapPage /> </> ) } -- Gitblit v1.9.1