Sanakey
5 天以前 2af71bcf522c485ea005184c977986374a7dcc4a
src/router/constant.ts
@@ -1,46 +1,25 @@
import type { AppRouteRecordRaw } from '/@/router/types';
export const REDIRECT_NAME = 'Redirect';
const EXCEPTION_COMPONENT = () => import('../views/sys/exception/Exception');
export const PARENT_LAYOUT_NAME = 'ParentLayout';
export const PAGE_NOT_FOUND_NAME = 'PageNotFound';
export const EXCEPTION_COMPONENT = () => import('@/views/sys/exception/Exception.vue');
/**
 * @description: default layout
 */
export const DEFAULT_LAYOUT_COMPONENT = () => import('/@/layouts/default/index');
export const LAYOUT = () => import('@/layouts/default/index.vue');
export const EMAILLAYOUT = () => import('@/layouts/default/email.vue');
/**
 * @description: page-layout
 * @description: parent-layout
 */
export const PAGE_LAYOUT_COMPONENT = () => import('/@/layouts/page/index');
// 404 on a page
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
  path: '/:path(.*)*',
  name: 'ErrorPage',
  component: EXCEPTION_COMPONENT,
  meta: {
    title: 'ErrorPage',
    hideBreadcrumb: true,
  },
export const getParentLayout = (_name?: string) => {
  return () =>
    new Promise((resolve) => {
      resolve({
        name: _name || PARENT_LAYOUT_NAME,
      });
    });
};
export const REDIRECT_ROUTE: AppRouteRecordRaw = {
  path: '/redirect/:path(.*)*',
  name: 'Redirect',
  component: () => import('/@/views/sys/redirect/index.vue'),
  meta: {
    title: 'Redirect',
    hideBreadcrumb: true,
  },
};
// Whole site 404
// export const FULL_PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
//   path: '/:path(.*)*',
//   name: 'FullErrorPage',
//   component: EXCEPTION_COMPONENT,
//   props: {
//     full: true,
//   },
//   meta: {
//     title: 'FullErrorPage',
//   },
// };