text: // The Vue build version to load with the `import` command
  // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  import Vue from 'vue'
  import App from './App'
  import router from './router'
  import ElementUI from 'element-ui'
  import 'element-ui/lib/theme-chalk/index.css'
  import store from './store'
  
  Vue.config.productionTip = false
  
  // 设置反向代理
  var axios = require('axios')
  axios.defaults.baseURL = 'http://localhost:8663/api'
  
  // 全局注册，其他组件可通过this.$axios发送数据
  Vue.prototype.$axios = axios
  Vue.config.productionTip = false
  
  // eslint-disable-next-line no-undef
  Vue.use(ElementUI)
  
  router.beforeEach((to, from, next) => {
    if (to.meta.requireAuth) {
      if (store.state.user.name) {
        next()
      } else {
        next({
          path: 'login',
          query: {redirect: to.fullPath}
        })
      }
    } else {
      next()
    }
  })
  /* eslint-disable no-new */
  new Vue({
    el: '#app',
    render: h => h(App),
    router,
    store,
    components: { App },
    template: '<App/>'
  })
  