You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RuoYi-Vue/ruoyi-ui-next/src/router/constant.ts

51 lines
1.1 KiB

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 },
},
],
},
// Catch-all 404 - must be added last
{
path: '/:pathMatch(.*)*',
redirect: '/404',
meta: { hidden: true },
},
]