text: import '@/assets/css/base.css'
  import { deleteRequest, getRequest, postKeyValueRequest, postRequest, putRequest } from '@/utils/request'
  import ElementUI from 'element-ui'
  import 'element-ui/lib/theme-chalk/index.css'
  import 'font-awesome/css/font-awesome.min.css'
  import Vue from 'vue'
  import App from './App.vue'
  import './plugins/element.js'
  import router from './router'
  import store from './store'
  import { initMenu } from './utils/menus'
  
  // 将请求工具注册到Vue的全局组件
  Vue.prototype.postKeyValueRequest = postKeyValueRequest
  Vue.prototype.getRequest = getRequest
  Vue.prototype.postRequest = postRequest
  Vue.prototype.putRequest = putRequest
  Vue.prototype.deleteRequest = deleteRequest
  
  Vue.config.productionTip = false
  
  Vue.use(ElementUI)
  
  let i = 0
  // 全局路由守卫
  router.beforeEach((to, from, next) => {
    if (to.path === '/') {
      next()
    } else {
      if (window.sessionStorage.getItem('user')) {
        initMenu(router, store)
        next()
      } else {
        next('/?redirect=' + to.path)
      }
    }
  })
  
  new Vue({
    router,
    store,
    render: h => h(App)
  }).$mount('#app')
  