162 lines
3.5 KiB
JavaScript
162 lines
3.5 KiB
JavaScript
import Vue from 'vue'
|
|
import VueRouter from 'vue-router'
|
|
import HomeView from '../views/HomeView.vue'
|
|
import Login from '@/views/auth/Login.vue'
|
|
import Register from '@/views/auth/Register.vue'
|
|
import Notfound from '@/views/Notfound.vue'
|
|
Vue.use(VueRouter)
|
|
|
|
const routes = [
|
|
{
|
|
path: '/home',
|
|
name: 'home',
|
|
component: HomeView
|
|
}
|
|
, {
|
|
path: '',
|
|
redirect: '/home'
|
|
},
|
|
{
|
|
path: '/auth',
|
|
component: Login,
|
|
children: [
|
|
{
|
|
path: 'login',
|
|
component: Login
|
|
},
|
|
{
|
|
path: 'register',
|
|
component: Register
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: '/layout',
|
|
component: () => import('@/views/layout/Home.vue'),
|
|
redirect: '/layout/index',
|
|
children: [
|
|
{
|
|
path: 'index',
|
|
component: () => import('@/views/layout/Dashboard.vue'),
|
|
meta: {
|
|
title: '主页',
|
|
icon: 'home',
|
|
showInMenu: true,
|
|
showInUser: false,
|
|
isHome: true
|
|
}
|
|
},
|
|
{
|
|
path: 'users',
|
|
component: () => import('@/views/layout/Users.vue'),
|
|
meta: {
|
|
title: '用户管理',
|
|
icon: 'users',
|
|
showInMenu: true,
|
|
showInUser: false,
|
|
isHome: false
|
|
}
|
|
},
|
|
{
|
|
path: 'apis',
|
|
component: () => import('@/views/layout/APIs.vue'),
|
|
meta: {
|
|
title: 'API管理',
|
|
icon: 'layers',
|
|
showInMenu: true,
|
|
showInUser: false,
|
|
isHome: false
|
|
}
|
|
},
|
|
{
|
|
path: 'packages',
|
|
component: () => import('@/views/layout/Packages.vue'),
|
|
meta: {
|
|
title: '套餐管理',
|
|
icon: 'grid',
|
|
showInMenu: true,
|
|
showInUser: false,
|
|
isHome: false
|
|
}
|
|
},
|
|
{
|
|
path: 'buypackage',
|
|
component: () => import('@/views/layout/BuyPackage.vue'),
|
|
meta: {
|
|
title: '套餐购买',
|
|
icon: 'shopping-bag',
|
|
showInMenu: true,
|
|
showInUser: true,
|
|
isHome: false
|
|
}
|
|
},
|
|
{
|
|
path: 'orders',
|
|
component: () => import('@/views/layout/Orders.vue'),
|
|
meta: {
|
|
title: '订单管理',
|
|
icon: 'shopping-cart',
|
|
showInMenu: true,
|
|
showInUser: false,
|
|
isHome: false
|
|
}
|
|
},
|
|
{
|
|
path: 'balance',
|
|
component: () => import('@/views/layout/Balance.vue'),
|
|
meta: {
|
|
title: '充值中心',
|
|
icon: 'dollar-sign',
|
|
showInMenu: true,
|
|
showInUser: true,
|
|
isHome: false
|
|
}
|
|
},
|
|
{
|
|
path: 'records',
|
|
component: () => import('@/views/layout/Records.vue'),
|
|
meta: {
|
|
title: '消费记录',
|
|
icon: 'archive',
|
|
showInMenu: true,
|
|
showInUser: true,
|
|
isHome: false
|
|
}
|
|
},
|
|
{
|
|
path: 'system',
|
|
component: () => import('@/views/layout/SystemConfig.vue'),
|
|
meta: {
|
|
title: '系统设置',
|
|
icon: 'settings',
|
|
showInMenu: true,
|
|
showInUser:false,
|
|
isHome:false
|
|
}
|
|
},
|
|
{
|
|
path: 'center',
|
|
component: () => import('@/views/layout/PersonalCenter.vue'),
|
|
meta: {
|
|
title: '个人中心',
|
|
icon: 'user',
|
|
showInMenu: false,
|
|
showInUser:true,
|
|
isHome:false
|
|
}
|
|
},
|
|
]
|
|
},
|
|
{
|
|
path: '*',
|
|
name: 'NotFound',
|
|
component: Notfound
|
|
}
|
|
]
|
|
|
|
const router = new VueRouter({
|
|
mode: 'history',
|
|
routes
|
|
})
|
|
|
|
export default router |