import Vue from "vue";
import VueRouter from "vue-router";
import RouterGuard from "./router.config";
Vue.use(VueRouter);
// 布局容器
import Layout from "../views/layout/index.vue";
// 登录模块
import author from "./modules/author";
// 客户管理
import customer from "./modules/customer";
// 福利信息管理
import welfare from "./modules/welfare";
// 预授权信息管理
import preAuth from "./modules/pre-auth";
// 收费查询
import chargeQuery from "./modules/charge-query";
// 核销管理
import verification from "./modules/verification";
// 信息维护
import info from "./modules/info";
// 报表管理
import bi from "./modules/bi";

const routes = [
  {
    path: "/",
    component: Layout,
    children: [
      {
        path: "/",
        redirect: "/login",
      },
      customer,
      welfare,
      preAuth,
      chargeQuery,
      verification,
      info,
      bi,
    ],
  },
  author,
];

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

RouterGuard(VueRouter, router);

export default router;
