feat: 初始化应用基础结构,包括路由、全局上下文提供者和通用布局组件。

This commit is contained in:
2026-01-30 10:20:20 +08:00
parent 3459dc6237
commit 2551bb0792
3 changed files with 5 additions and 7 deletions

View File

@@ -9,9 +9,6 @@ import { ThemeProvider, PrivacyProvider, NotificationProvider, GuideProvider, us
* Wrapped by providers, uses hooks
*/
function AppContent() {
// Enable automatic token refresh
useAutoTokenRefresh();
return <RouterProvider router={router} />;
}

View File

@@ -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 (
<div className={`app-layout ${isZenMode ? 'zen-mode' : ''}`}>
{isZenMode && (

View File

@@ -4,7 +4,5 @@ import './index.css';
import App from './App.tsx';
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>
<App />
);