import Vue from 'vue' import Router from 'vue-router' import Login from '@/pages/Login' import ExternalContact from '@/pages/ExternalContact' import Home from '@/pages/Home' import AccountManager from '@/pages/user/AccountManager' import RoleManager from '@/pages/user/RoleManager' import ShopIncrease from '@/pages/shop/ShopIncrease' Vue.use(Router); const router = new Router({ mode: 'history', base: '/kiisoo-ic', routes: [ { path: '/', redirect: '/login' }, { path: '/login', name: 'login', component: Login }, { path: '/externalContact', name: 'externalContact', component: ExternalContact }, { path: '/home', name: 'Home', component: Home, children: [ { path: '/AccountManager', name: 'AccountManager', component: AccountManager }, { path: '/RoleManager', name: 'RoleManager', component: RoleManager }, { path: '/ShopIncrease', name: 'ShopIncrease', component: ShopIncrease } ] } ] }); /* * 跳转前的处理事件 * */ router.beforeEach(function (to, from, next) { next(); }); export default router