Optimize code
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
import React from 'react'
|
||||
import _ from 'lodash'
|
||||
import system from '@/router/system'
|
||||
import user from '@/router/user'
|
||||
import tools from '@/router/tools'
|
||||
import { getAuthRoute, mapJsonToRoute, setTitle } from '@/util/route'
|
||||
|
||||
const lazySignPage = React.lazy(() => import('@/pages/Sign'))
|
||||
const lazySignPage = lazy(() => import('@/pages/Sign'))
|
||||
|
||||
const root: RouteJsonObject[] = [
|
||||
{
|
||||
path: '/',
|
||||
absolutePath: '/',
|
||||
component: React.lazy(() => import('@/AuthRoute')),
|
||||
component: lazy(() => import('@/AuthRoute')),
|
||||
children: [
|
||||
{
|
||||
path: 'register',
|
||||
@@ -41,13 +40,13 @@ const root: RouteJsonObject[] = [
|
||||
path: 'loading',
|
||||
absolutePath: '/loading',
|
||||
id: 'loading',
|
||||
component: React.lazy(() => import('@/components/common/FullscreenLoadingMask'))
|
||||
component: lazy(() => import('@/components/common/FullscreenLoadingMask'))
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
absolutePath: '/user',
|
||||
id: 'userFramework',
|
||||
component: React.lazy(() => import('@/pages/UserFramework')),
|
||||
component: lazy(() => import('@/pages/UserFramework')),
|
||||
children: setTitle(user, '个人中心'),
|
||||
name: '个人中心',
|
||||
auth: true
|
||||
@@ -56,7 +55,7 @@ const root: RouteJsonObject[] = [
|
||||
path: 'system',
|
||||
absolutePath: '/system',
|
||||
id: 'systemFramework',
|
||||
component: React.lazy(() => import('@/pages/SystemFramework')),
|
||||
component: lazy(() => import('@/pages/SystemFramework')),
|
||||
children: setTitle(system, '系统配置'),
|
||||
name: '系统配置',
|
||||
auth: true,
|
||||
@@ -66,14 +65,14 @@ const root: RouteJsonObject[] = [
|
||||
path: 'online-editor',
|
||||
absolutePath: '/online-editor',
|
||||
id: 'online-editor',
|
||||
component: React.lazy(() => import('@/pages/OnlineEditor')),
|
||||
component: lazy(() => import('@/pages/OnlineEditor')),
|
||||
name: '在线编辑器'
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
absolutePath: '/',
|
||||
id: 'toolsFramework',
|
||||
component: React.lazy(() => import('@/pages/ToolsFramework')),
|
||||
component: lazy(() => import('@/pages/ToolsFramework')),
|
||||
children: setTitle(tools, '氧工具'),
|
||||
name: '工具',
|
||||
auth: false
|
||||
|
||||
Reference in New Issue
Block a user