/*
 * @Author: 付刚
 * @Date: 2021-06-03 18:21:29
 * @LastEditors: 付刚
 * @LastEditTime: 2021-09-02 10:27:21
 * @FilePath: \MuduAPP\src\router\index.js
 */
// 总路由
import Vue from 'vue'
import Router from 'vue-router'

import store from '@/store'
Vue.use(Router)
// 引入其他路由文件

import vxEwm from '@/router/vxEwm.js'
const baseRoutes = []

const routes = baseRoutes.concat(vxEwm)

const router = new Router({ routes })

// 路由拦截
router.beforeEach((to, from, next) => {
  store.commit('SET_IS_SHOW', {
    text: to.name == '企业详情' ? '工业园' : to.name == '企业详情2' ? '楼栋': '企业',
    isShow: to.query.isShow || to.params.isShow,
  })
  // console.log(to)
  next()
})

export default router
