diff --git a/src/router/index.ts b/src/router/index.ts index fbd858f..309f9b4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -164,9 +164,16 @@ router.beforeEach(async (to) => { if (!adminDynamicRoutesRegistered()) { await registerAdminDynamicRoutes(router) + if (to.name === 'AdminLayout' || to.path === '/admin') { + return { name: 'admin-dashboard', replace: true } + } return { ...to, replace: true } } + if (to.name === 'AdminLayout' || to.path === '/admin') { + return { name: 'admin-dashboard', replace: true } + } + return true }