feat(web): migrate account and user management to React
Add React account and user administration flows, including TOTP and SSO handling. Route /next SSO callbacks to React while preserving the existing Vue and native app behavior, and cover the routing policy with API tests.
This commit is contained in:
1 parent
24d2a96144
commit
93ab6a7b9e
17 files changed
+1058
-60
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { lazy, Suspense, useEffect } from 'react'
|
||||
import { ConfigProvider, Skeleton } from 'antd'
|
||||
import { App as AntdApp, ConfigProvider, Skeleton } from 'antd'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { BrowserRouter, Navigate, Route, Routes, useLocation, useNavigate } from 'react-router-dom'
|
||||
import zhCN from 'antd/locale/zh_CN'
|
||||
@@ -7,7 +7,10 @@ import { useAuthStore } from '../stores/auth'
|
||||
|
||||
const LoginPage = lazy(() => import('../pages/LoginPage'))
|
||||
const DashboardPage = lazy(() => import('../pages/DashboardPage'))
|
||||
const MigrationPlaceholderPage = lazy(() => import('../pages/MigrationPlaceholderPage'))
|
||||
const AccountPage = lazy(() => import('../pages/AccountPage'))
|
||||
const UsersPage = lazy(() => import('../pages/UsersPage'))
|
||||
const SsoCallbackPage = lazy(() => import('../pages/SsoCallbackPage'))
|
||||
const SsoBindPage = lazy(() => import('../pages/SsoBindPage'))
|
||||
const AppShell = lazy(() => import('../layout/AppShell'))
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
@@ -43,10 +46,12 @@ function AppRoutes() {
|
||||
<SessionExpiryBridge />
|
||||
<Routes>
|
||||
<Route path="/login" element={<LoginPage />} />
|
||||
<Route path="/sso/callback" element={<SsoCallbackPage />} />
|
||||
<Route path="/sso/bind" element={<SsoBindPage />} />
|
||||
<Route element={<ProtectedRoute />}>
|
||||
<Route path="/dashboard" element={<DashboardPage />} />
|
||||
<Route path="/account" element={<MigrationPlaceholderPage />} />
|
||||
<Route path="/users" element={<MigrationPlaceholderPage />} />
|
||||
<Route path="/account" element={<AccountPage />} />
|
||||
<Route path="/users" element={<UsersPage />} />
|
||||
<Route path="/" element={<Navigate to="/dashboard" replace />} />
|
||||
</Route>
|
||||
<Route path="*" element={<Navigate to="/dashboard" replace />} />
|
||||
@@ -79,9 +84,11 @@ export default function App() {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<BrowserRouter basename="/next"><AppRoutes /></BrowserRouter>
|
||||
</QueryClientProvider>
|
||||
<AntdApp>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<BrowserRouter basename="/next"><AppRoutes /></BrowserRouter>
|
||||
</QueryClientProvider>
|
||||
</AntdApp>
|
||||
</ConfigProvider>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user