vben
2020-11-26 19011296ed61f820356f6b201cbb274d57dcb7d3
提交 | 用户 | age
2f6253 1 import type { AppRouteRecordRaw, AppRouteModule } from '/@/router/types';
2
3 import { DEFAULT_LAYOUT_COMPONENT, PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '../constant';
4 import { genRouteModule } from '/@/utils/helper/routeHelper';
8a1bfd 5 import modules from 'globby!/@/router/routes/modules/**/*.@(ts)';
2f6253 6
e23336 7 const routeModuleList: AppRouteModule[] = [];
2f6253 8
8a1bfd 9 Object.keys(modules).forEach((key) => {
V 10   routeModuleList.push(modules[key]);
11 });
12
2f6253 13 export const asyncRoutes = [
14   REDIRECT_ROUTE,
15   PAGE_NOT_FOUND_ROUTE,
16   ...genRouteModule(routeModuleList),
17 ];
e23336 18
2f6253 19 // 主框架根路由
20 export const RootRoute: AppRouteRecordRaw = {
21   path: '/',
22   name: 'Root',
23   component: DEFAULT_LAYOUT_COMPONENT,
24   redirect: '/dashboard',
25   meta: {
26     title: 'Root',
27   },
28   children: [],
29 };
30
31e271 31 export const LoginRoute: AppRouteRecordRaw = {
V 32   path: '/login',
33   name: 'Login',
34   component: () => import('/@/views/sys/login/Login.vue'),
35   meta: {
190112 36     title: 'routes.basic.login',
31e271 37   },
V 38 };
39
2f6253 40 // 基础路由 不用权限
41 export const basicRoutes = [LoginRoute, RootRoute];