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 IncreaseManager from '@/pages/shop/IncreaseManager'; import CustomerData from "@/pages/CustomerData"; import IncreaseData from '@/pages/shop/IncreaseData'; import IncreaseDataRegion from '@/pages/shop/IncreaseDataRegion'; import IncreaseDataStaff from '@/pages/shop/IncreaseDataStaff'; import IncreaseDataStore from '@/pages/shop/IncreaseDataStore'; Vue.use(Router); const router = new Router({ mode: 'history', base: '/kiisoo-ic', routes: [ { path: '/', redirect: '/login' }, { path: '/login', name: 'login', component: Login }, { path: '/external/contact', name: 'externalContact', component: ExternalContact }, { path: '/home', name: 'Home', component: Home, children: [ { path: '/account/manager', name: 'AccountManager', component: AccountManager }, { path: '/role/manager', name: 'RoleManager', component: RoleManager }, { path: '/shop/increase/manager', name: 'IncreaseManager', component: IncreaseManager, children: [ { path: '/', redirect: '/shop/increase/manager/store' }, { path: '/shop/increase/manager/store', name: 'IncreaseDataRegion', component: IncreaseDataRegion }, { path: '/shop/increase/manager/staff', name: 'IncreaseDataStore', component: IncreaseDataStore } ] }, { path: '/shop/increase/data', name: 'IncreaseData', component: IncreaseData, children: [ { path: '/', redirect: '/shop/increase/data/region' }, { path: '/shop/increase/data/region', name: 'IncreaseDataRegion', component: IncreaseDataRegion }, { path: '/shop/increase/data/store', name: 'IncreaseDataStore', component: IncreaseDataStore }, { path: '/shop/increase/data/staff', name: 'IncreaseDataStaff', component: IncreaseDataStaff }, ] }, { path: '/customer/data', name: 'CustomerData', component: CustomerData, } ] } ] }); /* * 跳转前的处理事件 * */ router.beforeEach(function (to, from, next) { next(); }); export default router