Optimize code

This commit is contained in:
2023-11-01 10:31:14 +08:00
parent 4bfe37acfe
commit d26c4da45f
8 changed files with 24 additions and 17 deletions

View File

@@ -1,7 +1,8 @@
import React from 'react'
import tools from '@/router/tools'
import home from '@/router/home'
import user from '@/router/user.tsx'
import user from '@/router/user'
import system from '@/router/system'
const mapJsonToRoute = (jsonObject: RouteJsonObject[]): RouteObject[] => {
return jsonObject.map((value) => ({
@@ -69,6 +70,15 @@ const root: RouteJsonObject[] = [
name: '个人中心',
auth: true
},
{
path: 'system',
absolutePath: '/system',
id: 'systemFramework',
component: React.lazy(() => import('@/pages/SystemFramework')),
children: setTitle(system, '系统设置'),
name: '系统设置',
auth: true
},
{
path: '',
absolutePath: '/',

View File

@@ -3,6 +3,7 @@ import React from 'react'
const user: RouteJsonObject[] = [
{
path: '',
absolutePath: '/user',
id: 'user',
name: '个人档案',
icon: React.lazy(() => import('~icons/fatweb/user.jsx')),
@@ -10,6 +11,7 @@ const user: RouteJsonObject[] = [
},
{
path: '*',
absolutePath: '*',
element: <Navigate to="/user" replace />
}
]