text: import { getBreadCrumbList, setTagNavListInLocalstorage, getMenuByRouter, getTagNavListFromLocalstorage, getHomeRoute, routeHasExist } from '@/libs/util'
  import routes from '../../router'
  import routers from './routers'
  export default {
    state: {
      breadCrumbList: [],
      tagNavList: [],
      homeRoute: getHomeRoute(routes.constantRoutes),
      local: ''
    },
    getters: {
      menuList: (state, getters, rootState) => getMenuByRouter(routers.state.allRoute, rootState.user.access)
    },
    mutations: {
      setBreadCrumb (state, routeMetched) {
        state.breadCrumbList = getBreadCrumbList(routeMetched, state.homeRoute)
      },
      setTagNavList (state, list) {
        if (list) {
          state.tagNavList = [...list]
          setTagNavListInLocalstorage([...list])
        } else state.tagNavList = getTagNavListFromLocalstorage()
      },
      addTag (state, { route, type = 'unshift' }) {
        if (!routeHasExist(state.tagNavList, route)) {
          if (type === 'push') state.tagNavList.push(route)
          else {
            if (route.name === 'home') state.tagNavList.unshift(route)
            else state.tagNavList.splice(1, 0, route)
          }
          setTagNavListInLocalstorage([...state.tagNavList])
        }
      },
      setLocal (state, lang) {
        state.local = lang
      }
    }
  }
  