From 67caf2c1ddeb74010aaf3850e561002146f12392 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期四, 10 十月 2024 08:49:49 +0800 Subject: [PATCH] # --- zy-acs-flow/src/page/settings/Settings.jsx | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/zy-acs-flow/src/page/settings/Settings.jsx b/zy-acs-flow/src/page/settings/Settings.jsx index 17ac881..7833c47 100644 --- a/zy-acs-flow/src/page/settings/Settings.jsx +++ b/zy-acs-flow/src/page/settings/Settings.jsx @@ -1,4 +1,5 @@ import React, { useState, useRef, useEffect, useMemo } from "react"; +import { useNavigate } from 'react-router-dom'; import { Edit, SimpleForm, @@ -15,6 +16,7 @@ required, useRecordContext, useTheme, + useAuthProvider, } from 'react-admin'; import { useWatch, useFormContext } from "react-hook-form"; import { Stack, Grid, Box, Typography, Card, CardContent, Tabs, Tab } from '@mui/material'; @@ -22,11 +24,19 @@ import { } from '@/config/setting'; const Settings = () => { + const authProvider = useAuthProvider(); + const navigate = useNavigate(); const translate = useTranslate(); const theme = useTheme(); const [value, setValue] = React.useState(0); useEffect(() => { + authProvider.checkAuth().catch(() => { + navigate('/login'); + }); + }, [authProvider, navigate]); + + useEffect(() => { }, [value]); return ( -- Gitblit v1.9.1