Optimize code
This commit is contained in:
@@ -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: '/',
|
||||
|
||||
@@ -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 />
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user