import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/home/HomeView.vue'
import SaasManage from '@/views/saasManage/indexPage.vue'
import LoginPage from '@/views/LoginPage.vue'
import menuPage from '@/views/menu.vue'

export const DEFAULT_DASHBOARD = 'saasManage'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: LoginPage,
  },
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/saas/manage',
    children: [
      {
        path: '/saas/manage',
        name: 'saasManage',
        meta: { title: 'SaaS管理页面' },
        component: SaasManage,
      },
      {
        path: '/saas/menu',
        component: menuPage,
        name: 'saasMenu',
        meta: { title: '菜单管理' },
      },
    ],
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
})

export default router
