Skip to content

Commit

Permalink
refactor(projects): constant routes, route guard
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Apr 13, 2024
1 parent 886ea57 commit ddec7d8
Show file tree
Hide file tree
Showing 14 changed files with 360 additions and 220 deletions.
23 changes: 16 additions & 7 deletions src/router/elegant/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export const generatedRoutes: GeneratedRoute[] = [
meta: {
title: '403',
i18nKey: 'route.403',
constant: true
constant: true,
hideInMenu: true
}
},
{
Expand All @@ -23,7 +24,8 @@ export const generatedRoutes: GeneratedRoute[] = [
meta: {
title: '404',
i18nKey: 'route.404',
constant: true
constant: true,
hideInMenu: true
}
},
{
Expand All @@ -33,7 +35,8 @@ export const generatedRoutes: GeneratedRoute[] = [
meta: {
title: '500',
i18nKey: 'route.500',
constant: true
constant: true,
hideInMenu: true
}
},
{
Expand Down Expand Up @@ -64,7 +67,8 @@ export const generatedRoutes: GeneratedRoute[] = [
meta: {
title: 'function_hide-child',
i18nKey: 'route.function_hide-child',
icon: 'material-symbols:filter-list-off'
icon: 'material-symbols:filter-list-off',
order: 2
},
redirect: '/function/hide-child/one',
children: [
Expand Down Expand Up @@ -183,7 +187,8 @@ export const generatedRoutes: GeneratedRoute[] = [
meta: {
title: 'login',
i18nKey: 'route.login',
constant: true
constant: true,
hideInMenu: true
}
},
{
Expand All @@ -204,7 +209,11 @@ export const generatedRoutes: GeneratedRoute[] = [
component: 'view.manage_menu',
meta: {
title: 'manage_menu',
i18nKey: 'route.manage_menu'
i18nKey: 'route.manage_menu',
icon: 'material-symbols:route',
order: 3,
roles: ['R_ADMIN'],
keepAlive: true
}
},
{
Expand All @@ -216,7 +225,7 @@ export const generatedRoutes: GeneratedRoute[] = [
i18nKey: 'route.manage_role',
icon: 'carbon:user-role',
order: 2,
roles: ['R_ADMIN']
roles: ['R_SUPER']
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/router/guard/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Router } from 'vue-router';
import { createRouteGuard } from './route';
import { createProgressGuard } from './progress';
import { createDocumentTitleGuard } from './title';
import { createPermissionGuard } from './permission';

/**
* Router guard
Expand All @@ -10,6 +10,6 @@ import { createPermissionGuard } from './permission';
*/
export function createRouterGuard(router: Router) {
createProgressGuard(router);
createPermissionGuard(router);
createRouteGuard(router);
createDocumentTitleGuard(router);
}
142 changes: 0 additions & 142 deletions src/router/guard/permission.ts

This file was deleted.

Loading

0 comments on commit ddec7d8

Please sign in to comment.