refactor(projects): 路由声明重构,添加composables,BaseLayout进行中,文件夹规范

This commit is contained in:
Soybean
2021-11-19 01:33:36 +08:00
parent 1c5fdca596
commit 1e84d13d54
75 changed files with 668 additions and 565 deletions

View File

@ -1,53 +1,53 @@
import type { CustomRoute } from '@/interface';
import { EnumRoutePath, EnumRouteTitle } from '@/enum';
import { BasicLayout } from '@/layouts';
import { ROUTE_NAME_MAP, setRouterCacheName } from '@/utils';
import { setRouterCacheName } from '@/utils';
import Exception403 from '@/views/system/exception/403.vue';
import Exception404 from '@/views/system/exception/404.vue';
import Exception500 from '@/views/system/exception/500.vue';
import { routeName, routePath, routeTitle } from '../const';
setRouterCacheName(Exception404, ROUTE_NAME_MAP.get('exception_404'));
setRouterCacheName(Exception403, ROUTE_NAME_MAP.get('exception_403'));
setRouterCacheName(Exception500, ROUTE_NAME_MAP.get('exception_500'));
setRouterCacheName(Exception404, routeName('exception_404'));
setRouterCacheName(Exception403, routeName('exception_403'));
setRouterCacheName(Exception500, routeName('exception_500'));
const EXCEPTION: CustomRoute = {
name: ROUTE_NAME_MAP.get('exception'),
path: EnumRoutePath.exception,
name: routeName('exception'),
path: routePath('exception'),
component: BasicLayout,
redirect: { name: ROUTE_NAME_MAP.get('exception_403') },
redirect: { name: routeName('exception_403') },
meta: {
requiresAuth: true,
title: EnumRouteTitle.exception,
title: routeTitle('exception'),
icon: 'ant-design:exception-outlined'
},
children: [
{
name: ROUTE_NAME_MAP.get('exception_403'),
path: EnumRoutePath.exception_403,
name: routeName('exception_403'),
path: routePath('exception_403'),
component: Exception403,
meta: {
requiresAuth: true,
title: EnumRouteTitle.exception_403,
title: routeTitle('exception_403'),
fullPage: true
}
},
{
name: ROUTE_NAME_MAP.get('exception_404'),
path: EnumRoutePath.exception_404,
name: routeName('exception_404'),
path: routePath('exception_404'),
component: Exception404,
meta: {
requiresAuth: true,
title: EnumRouteTitle.exception_404,
title: routeTitle('exception_404'),
fullPage: true
}
},
{
name: ROUTE_NAME_MAP.get('exception_500'),
path: EnumRoutePath.exception_500,
name: routeName('exception_500'),
path: routePath('exception_500'),
component: Exception500,
meta: {
requiresAuth: true,
title: EnumRouteTitle.exception_500,
title: routeTitle('exception_500'),
fullPage: true
}
}