index.ts 1019 B

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