From 2551bb07920a6e511dfc1e9d65308dc6e3409a32 Mon Sep 17 00:00:00 2001 From: admin <1297598740@qq.com> Date: Fri, 30 Jan 2026 10:20:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=9F=BA=E7=A1=80=E7=BB=93=E6=9E=84=EF=BC=8C=E5=8C=85?= =?UTF-8?q?=E6=8B=AC=E8=B7=AF=E7=94=B1=E3=80=81=E5=85=A8=E5=B1=80=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=96=87=E6=8F=90=E4=BE=9B=E8=80=85=E5=92=8C=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E5=B8=83=E5=B1=80=E7=BB=84=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 3 --- src/components/common/Layout/Layout.tsx | 5 ++++- src/main.tsx | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index fcb80f4..12acb1d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,9 +9,6 @@ import { ThemeProvider, PrivacyProvider, NotificationProvider, GuideProvider, us * Wrapped by providers, uses hooks */ function AppContent() { - // Enable automatic token refresh - useAutoTokenRefresh(); - return ; } diff --git a/src/components/common/Layout/Layout.tsx b/src/components/common/Layout/Layout.tsx index a5bfbd9..9aca5d0 100644 --- a/src/components/common/Layout/Layout.tsx +++ b/src/components/common/Layout/Layout.tsx @@ -1,6 +1,6 @@ import { Outlet } from 'react-router-dom'; -import { useTheme } from '../../../hooks'; +import { useTheme, useAutoTokenRefresh } from '../../../hooks'; import { Icon } from '@iconify/react'; import Navigation from '../Navigation'; import { CommandPalette } from '../CommandPalette'; @@ -16,6 +16,9 @@ import './Layout.css'; function Layout() { const { isZenMode, setZenMode } = useTheme(); + // Enable automatic token refresh within the authenticated layout + useAutoTokenRefresh(); + return (
{isZenMode && ( diff --git a/src/main.tsx b/src/main.tsx index df655ea..56a7094 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -4,7 +4,5 @@ import './index.css'; import App from './App.tsx'; createRoot(document.getElementById('root')!).render( - - - + );