import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import api from './request/api'
import Alert from '@/plugins/alert'
import Confirm from '@/plugins/confirm'
import MoneyDirective from '@/directives/money'
import 'jquery'
import 'bootstrap/dist/js/bootstrap.bundle.min.js'
import 'bootstrap/dist/css/bootstrap.min.css'
import './assets/css/main.min.css'
import './assets/plugins/font-awesome/css/all.min.css'
import 'perfect-scrollbar'
import "perfect-scrollbar/css/perfect-scrollbar.css"


Vue.config.productionTip = false

//挂载后端请求函数到全局
Vue.prototype.$api = api
Vue.use(Alert)
Vue.use(Confirm)

Vue.directive('money',MoneyDirective)

/**
 * 初始化系统
 */
async function initApp() {
  //初始化请求系统配置信息
  await store.dispatch('config/fetch_config')
  new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
}

initApp()