chore: route structure adjustment

This commit is contained in:
vben 2020-11-12 23:15:11 +08:00
parent cb1ae34f11
commit fc4666ef41
14 changed files with 54 additions and 25 deletions

View File

@ -43,7 +43,6 @@ export default defineComponent({
}
const lastChangeRoute = unref(tabStore.getLastChangeRouteState);
if (!lastChangeRoute || !userStore.getTokenState) return;
const { path, fullPath } = lastChangeRoute;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const dashboard: AppRouteModule = {
layout: {
path: '/dashboard',
name: 'Dashboard',
@ -41,4 +41,6 @@ export default {
},
},
],
} as AppRouteModule;
};
export default dashboard;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const charts: AppRouteModule = {
layout: {
path: '/charts',
name: 'Charts',
@ -57,4 +57,6 @@ export default {
component: () => import('/@/views/demo/echarts/apex/index.vue'),
},
],
} as AppRouteModule;
};
export default charts;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const comp: AppRouteModule = {
layout: {
path: '/comp',
name: 'Comp',
@ -179,4 +179,6 @@ export default {
},
},
],
} as AppRouteModule;
};
export default comp;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const editor: AppRouteModule = {
layout: {
path: '/editor',
name: 'Editor',
@ -51,4 +51,6 @@ export default {
],
},
],
} as AppRouteModule;
};
export default editor;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const excel: AppRouteModule = {
layout: {
path: '/excel',
name: 'Excel',
@ -48,4 +48,6 @@ export default {
},
},
],
} as AppRouteModule;
};
export default excel;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const feat: AppRouteModule = {
layout: {
path: '/feat',
name: 'FeatDemo',
@ -114,4 +114,6 @@ export default {
},
},
],
} as AppRouteModule;
};
export default feat;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const form: AppRouteModule = {
layout: {
path: '/form',
name: 'FormDemo',
@ -72,4 +72,5 @@ export default {
},
},
],
} as AppRouteModule;
};
export default form;

View File

@ -3,7 +3,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
const IFrame = () => import('/@/views/sys/iframe/FrameBlank.vue');
export default {
const iframe: AppRouteModule = {
layout: {
path: '/frame',
name: 'Frame',
@ -46,4 +46,6 @@ export default {
},
},
],
} as AppRouteModule;
};
export default iframe;

View File

@ -5,7 +5,7 @@ import { ExceptionEnum } from '/@/enums/exceptionEnum';
const ExceptionPage = () => import('/@/views/sys/exception/Exception');
export default {
const page: AppRouteModule = {
path: '/page-demo',
name: 'PageDemo',
component: PAGE_LAYOUT_COMPONENT,
@ -117,4 +117,6 @@ export default {
},
// =============================exception end=============================
],
} as AppRouteModule;
};
export default page;

View File

@ -3,7 +3,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
import { RoleEnum } from '/@/enums/roleEnum';
export default {
const permission: AppRouteModule = {
layout: {
path: '/permission',
name: 'Permission',
@ -25,6 +25,7 @@ export default {
children: [
{
path: 'page',
name: 'FrontPageAuth',
component: () => import('/@/views/demo/permission/front/index.vue'),
meta: {
title: '页面权限',
@ -32,6 +33,7 @@ export default {
},
{
path: 'btn',
name: 'FrontBtnAuth',
component: () => import('/@/views/demo/permission/front/Btn.vue'),
meta: {
title: '按钮权限',
@ -39,6 +41,7 @@ export default {
},
{
path: 'auth-pageA',
name: 'FrontAuthPageA',
component: () => import('/@/views/demo/permission/front/AuthPageA.vue'),
meta: {
title: '权限测试页A',
@ -47,6 +50,7 @@ export default {
},
{
path: 'auth-pageB',
name: 'FrontAuthPageB',
component: () => import('/@/views/demo/permission/front/AuthPageB.vue'),
meta: {
title: '权限测试页B',
@ -64,6 +68,7 @@ export default {
children: [
{
path: 'page',
name: 'BackAuthPage',
component: () => import('/@/views/demo/permission/back/index.vue'),
meta: {
title: '页面权限',
@ -71,6 +76,7 @@ export default {
},
{
path: 'btn',
name: 'BackAuthBtn',
component: () => import('/@/views/demo/permission/back/Btn.vue'),
meta: {
title: '按钮权限',
@ -79,4 +85,6 @@ export default {
],
},
],
} as AppRouteModule;
};
export default permission;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const table: AppRouteModule = {
layout: {
path: '/table',
name: 'TableDemo',
@ -128,4 +128,6 @@ export default {
},
},
],
} as AppRouteModule;
};
export default table;

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
export default {
const tree: AppRouteModule = {
layout: {
path: '/tree',
name: 'TreeDemo',
@ -39,4 +39,6 @@ export default {
},
},
],
} as AppRouteModule;
};
export default tree;

View File

@ -36,6 +36,7 @@ export interface RouteMeta {
}
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
name: string;
meta: RouteMeta;
component?: any;
components?: any;