import { createRouter, createWebHistory } from 'vue-router' import Login from '@/views/login/index.vue' const routes = [ { path: '/', redirect: '/login' // 默认重定向到登录页 }, { path: '/login', component: Login }, { path: '/user/home', component: () => import('@/views/home/UserHome.vue'), meta: { roles: ['PARTICIPANT'] } } ] const router = createRouter({ history: createWebHistory(), routes }) export default router