mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 02:00:25 +08:00
chore: route structure adjustment
This commit is contained in:
parent
cb1ae34f11
commit
fc4666ef41
@ -43,7 +43,6 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
const lastChangeRoute = unref(tabStore.getLastChangeRouteState);
|
||||
|
||||
if (!lastChangeRoute || !userStore.getTokenState) return;
|
||||
|
||||
const { path, fullPath } = lastChangeRoute;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
1
src/router/types.d.ts
vendored
1
src/router/types.d.ts
vendored
@ -36,6 +36,7 @@ export interface RouteMeta {
|
||||
}
|
||||
|
||||
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
|
||||
name: string;
|
||||
meta: RouteMeta;
|
||||
component?: any;
|
||||
components?: any;
|
||||
|
Loading…
Reference in New Issue
Block a user