You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/oaweb/src/router/routes.ts

50 lines
1014 B
TypeScript

import { Auths } from 'src/models/auth';
import { RouteRecordRaw } from 'vue-router';
declare module 'vue-router' {
interface RouteMeta {
// 是可选的
isAdmin?: boolean
title?: string
// 每个路由都必须声明
requiresAuth: boolean
checkAuth?: (a: Auths, r?: RouteLocationNormalized) => boolean
}
}
const routes: RouteRecordRaw[] = [
{
path: '/',
component: () => import('layouts/MainLayout.vue'),
meta: {
requiresAuth: true,
},
children: [
{
path: '',
component: () => import('pages/IndexPage.vue')
}
],
},
{
path: '/login/:uuid?',
name: 'login',
component: () => import('pages/login.vue'),
},
{
path: '/register/:uuid?',
name: 'register',
component: () => import('pages/register.vue'),
},
// Always leave this as last one,
// but you can also remove it
{
path: '/:catchAll(.*)*',
component: () => import('pages/ErrorNotFound.vue'),
},
];
export default routes;