import * as vueRouter from 'vue-router';

// 导入页面
import login from '../view/login/index.vue';
import home from '../view/home/index.vue';

export default vueRouter.createRouter({
  history: vueRouter.createWebHashHistory(),
  routes: [
    {
      path: '/',
      component: login,
    },
    {
      path: '/home',
      component: home,
      meta: {
        title: '首页',
      },
      children: [
        {
          path: '/admin/users',
          meta: {
            title: '人员管理',
          },
          children: [
            {
              path: '/admin/users/list',
              component: () => import('../view/system/index.vue'),
            },
            {
              path: '/admin/custom',
              component: () => import('../view/user/index.vue'),
            },
          ],
        },
        {
          path: '/admin/module',
          meta: {
            title: '菜单管理',
          },
          children: [],
          component: () => import('../view/menu/index.vue'),
        },
        {
          path: '/admin/region',
          meta: {
            title: '地域管理',
          },
          children: [],
          component: () => import('../view/region/index.vue'),
        },
        {
          path: '/admin/organ',
          meta: {
            title: '机构管理',
          },
          children: [],
          component: () => import('../view/institution/index.vue'),
        },
        {
          path: '/admin/live-stream',
          meta: {
            title: '直播流管理',
          },
          children: [],
          component: () => import('../view/liveStream/index.vue'),
        },
        {
          path: '/admin/leaders',
          meta: {
            title: '领导管理',
          },
          children: [],
          component: () => import('../view/leader/index.vue'),
        },
      ],
    },
  ],
});
