2020-09-28 20:19:10 +08:00
|
|
|
import type { AppRouteRecordRaw } from '/@/router/types';
|
2020-12-04 21:25:33 +08:00
|
|
|
import ParentLayout from '/@/layouts/page/ParentView.vue';
|
2021-02-13 11:15:06 +08:00
|
|
|
import { t } from '/@/hooks/web/useI18n';
|
2020-09-28 20:19:10 +08:00
|
|
|
|
2021-02-22 23:04:47 +08:00
|
|
|
export const REDIRECT_NAME = 'Redirect';
|
|
|
|
|
|
|
|
|
|
export const EXCEPTION_COMPONENT = () => import('../views/sys/exception/Exception.vue');
|
2020-09-28 20:19:10 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: default layout
|
|
|
|
|
*/
|
2020-12-13 22:05:34 +08:00
|
|
|
export const LAYOUT = () => import('/@/layouts/default/index.vue');
|
2020-09-28 20:19:10 +08:00
|
|
|
|
2020-12-03 21:49:32 +08:00
|
|
|
/**
|
|
|
|
|
* @description: page-layout
|
|
|
|
|
*/
|
|
|
|
|
export const getParentLayout = (name: string) => {
|
|
|
|
|
return () =>
|
|
|
|
|
new Promise((resolve) => {
|
|
|
|
|
resolve({
|
|
|
|
|
...ParentLayout,
|
|
|
|
|
name,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
2020-09-28 20:19:10 +08:00
|
|
|
|
|
|
|
|
// 404 on a page
|
|
|
|
|
export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
|
|
|
|
|
path: '/:path(.*)*',
|
|
|
|
|
name: 'ErrorPage',
|
2020-12-06 00:05:26 +08:00
|
|
|
component: LAYOUT,
|
2020-09-28 20:19:10 +08:00
|
|
|
meta: {
|
|
|
|
|
title: 'ErrorPage',
|
|
|
|
|
hideBreadcrumb: true,
|
|
|
|
|
},
|
2020-12-06 00:05:26 +08:00
|
|
|
children: [
|
|
|
|
|
{
|
2020-12-07 21:17:24 +08:00
|
|
|
path: '/:path(.*)*',
|
2020-12-06 00:05:26 +08:00
|
|
|
name: 'ErrorPage',
|
|
|
|
|
component: EXCEPTION_COMPONENT,
|
|
|
|
|
meta: {
|
|
|
|
|
title: 'ErrorPage',
|
|
|
|
|
hideBreadcrumb: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
2020-09-28 20:19:10 +08:00
|
|
|
};
|
2020-10-30 21:32:05 +08:00
|
|
|
|
2020-09-28 20:19:10 +08:00
|
|
|
export const REDIRECT_ROUTE: AppRouteRecordRaw = {
|
2020-12-03 21:49:32 +08:00
|
|
|
path: '/redirect',
|
|
|
|
|
name: REDIRECT_NAME,
|
|
|
|
|
component: LAYOUT,
|
2020-09-28 20:19:10 +08:00
|
|
|
meta: {
|
2020-12-03 21:49:32 +08:00
|
|
|
title: REDIRECT_NAME,
|
2020-09-28 20:19:10 +08:00
|
|
|
hideBreadcrumb: true,
|
|
|
|
|
},
|
2020-12-03 21:49:32 +08:00
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
path: '/redirect/:path(.*)',
|
|
|
|
|
name: REDIRECT_NAME,
|
|
|
|
|
component: () => import('/@/views/sys/redirect/index.vue'),
|
|
|
|
|
meta: {
|
|
|
|
|
title: REDIRECT_NAME,
|
|
|
|
|
hideBreadcrumb: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
2020-09-28 20:19:10 +08:00
|
|
|
};
|
2021-02-13 11:15:06 +08:00
|
|
|
|
|
|
|
|
export const ERROR_LOG_ROUTE: AppRouteRecordRaw = {
|
|
|
|
|
path: '/error-log',
|
|
|
|
|
name: 'errorLog',
|
|
|
|
|
component: LAYOUT,
|
|
|
|
|
meta: {
|
|
|
|
|
title: 'ErrorLog',
|
|
|
|
|
hideBreadcrumb: true,
|
|
|
|
|
},
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
path: 'list',
|
|
|
|
|
name: 'errorLogList',
|
|
|
|
|
component: () => import('/@/views/sys/error-log/index.vue'),
|
|
|
|
|
meta: {
|
|
|
|
|
title: t('routes.basic.errorLogList'),
|
|
|
|
|
hideBreadcrumb: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|