实现V4目录管理后台前端
This commit is contained in:
@@ -60,6 +60,7 @@ describe('reservation router', () => {
|
||||
expect(router.resolve('/system/roles').name).toBe('system-roles')
|
||||
expect(router.resolve('/system/menus').name).toBe('system-menus')
|
||||
expect(router.resolve('/system/hotels').name).toBe('system-hotels')
|
||||
expect(router.resolve('/system/reservation-catalogs').name).toBe('system-reservation-catalogs')
|
||||
expect(router.resolve('/system/audits').name).toBe('system-audits')
|
||||
expect(router.resolve('/system/not-ready').name).toBe('not-found')
|
||||
})
|
||||
@@ -81,6 +82,7 @@ describe('reservation router', () => {
|
||||
expect(router.resolve('/system/roles').meta.permission).toBe('SYSTEM_ROLE_MANAGE')
|
||||
expect(router.resolve('/system/menus').meta.permission).toBe('SYSTEM_MENU_MANAGE')
|
||||
expect(router.resolve('/system/hotels').meta.permission).toBe('HOTEL_MANAGE')
|
||||
expect(router.resolve('/system/reservation-catalogs').meta.permission).toBe('RESERVATION_CATALOG_MANAGE')
|
||||
expect(router.resolve('/system/audits').meta.permission).toBe('SYSTEM_ADMIN_CONSOLE_ACCESS')
|
||||
})
|
||||
|
||||
@@ -152,6 +154,19 @@ describe('reservation router', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('redirects the System Admin entry to catalog management when it is the first allowed admin page', async () => {
|
||||
const guard = createAuthGuard(() =>
|
||||
createAuthStoreForGuard({
|
||||
hasPermission: (permission: string) =>
|
||||
permission === 'SYSTEM_ADMIN_CONSOLE_ACCESS' || permission === 'RESERVATION_CATALOG_MANAGE',
|
||||
}),
|
||||
)
|
||||
|
||||
await expect(guard(createRoute('/system', { permission: 'SYSTEM_ADMIN_CONSOLE_ACCESS' }))).resolves.toBe(
|
||||
'/system/reservation-catalogs',
|
||||
)
|
||||
})
|
||||
|
||||
it('redirects the root route to the default page when the backend menu points to root', async () => {
|
||||
const guard = createAuthGuard(() =>
|
||||
createAuthStoreForGuard({
|
||||
|
||||
Reference in New Issue
Block a user