feat: 登录默认页改为我的工作台

This commit is contained in:
Hermes CI Fix
2026-08-16 11:00:19 +08:00
parent 7b5795bf07
commit acf0665010
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -3,7 +3,7 @@ import { hasRouteAccess } from '../permission'
const routes = [
{ path: '/login', name: 'Login', component: () => import('@/views/Login.vue'), meta: { noAuth: true } },
{ path: '/', component: () => import('@/layouts/MainLayout.vue'), redirect: '/dashboard',
{ path: '/', component: () => import('@/layouts/MainLayout.vue'), redirect: '/my-dashboard',
children: [
{ path: 'dashboard', name: 'Dashboard', component: () => import('@/views/Dashboard.vue'), meta: { title: '经营看板', roles: ['ceo', 'finance', 'business', 'it'] } },
{ path: 'kpis', name: 'KPIs', component: () => import('@/views/KPIList.vue'), meta: { title: 'KPI字典', roles: ['ceo', 'finance', 'business', 'it'] } },
@@ -62,7 +62,7 @@ router.beforeEach((to, _from, next) => {
// 不需要登录的页面(如登录页)
if (to.meta.noAuth) {
if (token && to.path === '/login') {
next('/dashboard')
next('/my-dashboard')
} else {
next()
}
@@ -82,8 +82,8 @@ router.beforeEach((to, _from, next) => {
const routeRoles = to.meta.roles as string[] | undefined
if (routeRoles && !routeRoles.includes(role)) {
// 权限不足,跳转到经营看板或401页
next('/dashboard')
// 权限不足,跳转到我的工作台
next('/my-dashboard')
return
}
} catch {