Blame view

src/router/constant.ts 1.37 KB
陈文彬 authored
1
import type { AppRouteRecordRaw } from '/@/router/types';
vben authored
2
import ParentLayout from '/@/layouts/page/ParentView.vue';
陈文彬 authored
3
4
5
6
7
8

const EXCEPTION_COMPONENT = () => import('../views/sys/exception/Exception');

/**
 * @description: default layout
 */
vben authored
9
export const LAYOUT = () => import('/@/layouts/default/index.vue');
陈文彬 authored
10
11
12
13

/**
 * @description: page-layout
 */
vben authored
14
15
16
17
18
19
20
21
22
export const getParentLayout = (name: string) => {
  return () =>
    new Promise((resolve) => {
      resolve({
        ...ParentLayout,
        name,
      });
    });
};
陈文彬 authored
23
24
25
26
27

// 404 on a page
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
  path: '/:path(.*)*',
  name: 'ErrorPage',
28
  component: LAYOUT,
陈文彬 authored
29
30
31
32
  meta: {
    title: 'ErrorPage',
    hideBreadcrumb: true,
  },
33
34
  children: [
    {
vben authored
35
      path: '/:path(.*)*',
36
37
38
39
40
41
42
43
      name: 'ErrorPage',
      component: EXCEPTION_COMPONENT,
      meta: {
        title: 'ErrorPage',
        hideBreadcrumb: true,
      },
    },
  ],
陈文彬 authored
44
};
vben authored
45
vben authored
46
47
export const REDIRECT_NAME = 'Redirect';
陈文彬 authored
48
export const REDIRECT_ROUTE: AppRouteRecordRaw = {
vben authored
49
50
51
  path: '/redirect',
  name: REDIRECT_NAME,
  component: LAYOUT,
陈文彬 authored
52
  meta: {
vben authored
53
    title: REDIRECT_NAME,
陈文彬 authored
54
55
    hideBreadcrumb: true,
  },
vben authored
56
57
58
59
60
61
62
63
64
65
66
  children: [
    {
      path: '/redirect/:path(.*)',
      name: REDIRECT_NAME,
      component: () => import('/@/views/sys/redirect/index.vue'),
      meta: {
        title: REDIRECT_NAME,
        hideBreadcrumb: true,
      },
    },
  ],
陈文彬 authored
67
};