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 | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/zy-acs-flow/src/page/dashboard/Dashboard.jsx b/zy-acs-flow/src/page/dashboard/Dashboard.jsx index 1b969f0..1c9389f 100644 --- a/zy-acs-flow/src/page/dashboard/Dashboard.jsx +++ b/zy-acs-flow/src/page/dashboard/Dashboard.jsx @@ -1,20 +1,21 @@ import React, { useState, useRef, useEffect, useMemo } from "react"; -import Player from "../../map/player"; - -let player; +import { useNavigate } from 'react-router-dom'; +import { useAuthProvider } from 'react-admin'; +import MapPage from "../../map/MapPage"; const Dashboard = () => { - const mapRef = React.useRef(); - + const authProvider = useAuthProvider(); + const navigate = useNavigate(); useEffect(() => { - player = new Player(mapRef.current) - }, []) + authProvider.checkAuth().catch(() => { + navigate('/login'); + }); + }, [authProvider, navigate]); return ( <> - <h1>Hello World</h1> - <div ref={mapRef} ></div> + <MapPage /> </> ) } -- Gitblit v1.9.1