text: import Vue from 'vue'
  import VueRouter from 'vue-router'
  import vClickOutside from 'v-click-outside'
  
  // Plugins
  import GlobalComponents from './gloablComponents'
  import Notifications from './components/UIComponents/NotificationPlugin'
  import SideBar from './components/UIComponents/SidebarPlugin'
  import App from './App'
  
  // router setup
  import routes from './routes/routes'
  
  // library imports
  import Chartist from 'chartist'
  import 'bootstrap/dist/css/bootstrap.css'
  import './assets/sass/paper-dashboard.scss'
  import 'es6-promise/auto'
  
  import store from './store'
  import { setToken, getToken } from '@/utils/auth'
  // plugin setup
  Vue.use(VueRouter)
  Vue.use(GlobalComponents)
  Vue.use(vClickOutside)
  Vue.use(Notifications)
  Vue.use(SideBar)
  
  // configure router
  const router = new VueRouter({
    routes, // short for routes: routes
    linkActiveClass: 'active'
  })
  // 判斷登入狀態
  router.beforeEach((route, redirect, next) => {
    let token = getToken()
    if (token) {
      store.commit('auth/updateToken', token)
    }
  
    if (route.path !== '/login' && store.state.auth.token === '') {
      alert('對不起, 您尚未登入')
      next({ path: '/login' })
    } else {
      next()
    }
  })
  
  // global library setup
  Object.defineProperty(Vue.prototype, '$Chartist', {
    get () {
      return this.$root.Chartist
    }
  })
  
  /* eslint-disable no-new */
  new Vue({
    el: '#app',
    render: h => h(App),
    router,
    store,
    data: {
      Chartist: Chartist
    }
  })
  