import type { RouteRecordRaw } from 'vue-router' /** * 静态路由(无需权限即可访问) */ export const constantRoutes: RouteRecordRaw[] = [ { path: '/login', name: 'Login', component: () => import('@/views/login.vue'), meta: { title: '登录', hidden: true }, }, { path: '/redirect/:path(.*)', name: 'Redirect', component: () => import('@/views/redirect.vue'), meta: { hidden: true }, }, { path: '/404', name: 'NotFound', component: () => import('@/views/error/404.vue'), meta: { title: '404', hidden: true }, }, { path: '/401', name: 'Unauthorized', component: () => import('@/views/error/401.vue'), meta: { title: '401', hidden: true }, }, { path: '/', component: () => import('@/layout/index.vue'), redirect: '/index', children: [ { path: 'index', name: 'Index', component: () => import('@/views/index.vue'), meta: { title: '首页', icon: 'HomeFilled', affix: true }, }, ], }, { path: '/dashboard', component: () => import('@/layout/index.vue'), redirect: '/dashboard/index', meta: { title: '行情总览', icon: 'TrendCharts' }, children: [ { path: 'index', name: 'DashboardIndex', component: () => import('@/views/dashboard/index.vue'), meta: { title: '行情总览', affix: true }, }, { path: 'heatmap', name: 'DashboardHeatmap', component: () => import('@/views/heatmap/index.vue'), meta: { title: '趋势热力' }, }, ], }, // Catch-all 404 - must be added last { path: '/:pathMatch(.*)*', redirect: '/404', meta: { hidden: true }, }, ]