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
f802598dab
commit
1ab9b76101
17 files changed
+1058
-60
No files matched your search
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from 'react'
|
||||
import {
|
||||
AppstoreOutlined,
|
||||
BellOutlined,
|
||||
ExportOutlined,
|
||||
IdcardOutlined,
|
||||
MenuFoldOutlined,
|
||||
MenuUnfoldOutlined,
|
||||
@@ -31,6 +32,7 @@ export default function AppShell() {
|
||||
...(user?.roles.includes('SuperAdmin')
|
||||
? [{ key: '/users', icon: <SafetyCertificateOutlined />, label: '用户与权限' }]
|
||||
: []),
|
||||
{ key: 'legacy', icon: <ExportOutlined />, label: '返回现有系统' },
|
||||
], [user?.roles])
|
||||
|
||||
const pageTitle = items.find((item) => location.pathname.startsWith(item.key))?.label ?? '迁移预览'
|
||||
@@ -58,9 +60,15 @@ export default function AppShell() {
|
||||
className="shell-menu"
|
||||
theme="dark"
|
||||
mode="inline"
|
||||
selectedKeys={[items.find((item) => location.pathname.startsWith(item.key))?.key ?? '/dashboard']}
|
||||
selectedKeys={[items.find((item) => item.key.startsWith('/') && location.pathname.startsWith(item.key))?.key ?? '/dashboard']}
|
||||
items={items}
|
||||
onClick={({ key }) => navigate(key)}
|
||||
onClick={({ key }) => {
|
||||
if (key === 'legacy') {
|
||||
window.location.assign(import.meta.env.VITE_LEGACY_APP_URL ?? 'http://localhost:5255')
|
||||
return
|
||||
}
|
||||
navigate(key)
|
||||
}}
|
||||
/>
|
||||
</Sider>
|
||||
<Layout>
|
||||
|
||||
Reference in new issue
Block a user