2024-03-15 10:59:17 +08:00
|
|
|
import VueRouter from "vue-router";
|
|
|
|
|
|
|
|
|
|
const routes=[
|
|
|
|
|
{
|
|
|
|
|
path:'/login',
|
|
|
|
|
name:'login',
|
|
|
|
|
component: () => import('../components/Login')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path:'/index',
|
|
|
|
|
name:'index',
|
|
|
|
|
component: () => import('../components/Index'),
|
|
|
|
|
children:[
|
|
|
|
|
{
|
|
|
|
|
path:'/home',
|
|
|
|
|
name:'home',
|
|
|
|
|
meta:{
|
|
|
|
|
title:'首页'
|
|
|
|
|
},
|
|
|
|
|
component: () => import('../components/Home')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path:'/admin',
|
|
|
|
|
name:'admin',
|
|
|
|
|
meta:{
|
|
|
|
|
title:'超级管理员'
|
|
|
|
|
},
|
|
|
|
|
component: () => import('../components/admin/Admin')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path:'/user',
|
|
|
|
|
name:'user',
|
|
|
|
|
meta:{
|
|
|
|
|
title:'用户'
|
|
|
|
|
},
|
|
|
|
|
component: () => import('../components/user/User')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path:'/admin',
|
|
|
|
|
name:'admin',
|
|
|
|
|
meta:{
|
|
|
|
|
title:'管理员'
|
|
|
|
|
},
|
|
|
|
|
component: () => import('../components/admin/Admin')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path:'/main',
|
|
|
|
|
name:'main',
|
|
|
|
|
meta:{
|
|
|
|
|
title:'用户管理'
|
|
|
|
|
},
|
|
|
|
|
component: () => import('../components/Main')
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const route=new VueRouter({
|
|
|
|
|
mode:'history',
|
|
|
|
|
routes
|
|
|
|
|
})
|
|
|
|
|
const VueRouterPush = VueRouter.prototype.push
|
|
|
|
|
VueRouter.prototype.push = function push (to) {
|
|
|
|
|
return VueRouterPush.call(this, to).catch(err => err)
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-15 15:54:57 +08:00
|
|
|
export default route;
|