/*
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2020-07-16 16:37:05
 * @LastEditors: 无尘
 * @LastEditTime: 2020-09-21 15:37:51
 */
import 'babel-polyfill';
import promise from 'es6-promise';
promise.polyfill();
import 'element-ui/lib/theme-chalk/index.css';
import '@/styles/reset.less';
import '@/styles/font/iconfont.css';

import Vue from 'vue';
import VueRouter from 'vue-router';
import axios from 'axios';
import ElementUI from 'element-ui';
import App from './App.vue';
import router from './router';
import { routes } from './router/routes.js';
import filters from '@/filters/index.js';
import { permission, itemPerm } from '@/utils/permission.js';
import { itemCode } from '@/config';

window.Vue = Vue;

Vue.use(VueRouter);
Vue.use(ElementUI);
// 请求头这种添加请求标识
axios.defaults.withCredentials = true;

Vue.prototype.axios = axios;
Vue.prototype.$itemPerm = itemPerm;
Vue.prototype.$itemCode = itemCode;

// 开启vue devtools.....
/* eslint-disable-next-line */
Vue.config.devtools = process.env.NODE_ENV !== 'production';
Vue.config.productionTip = false;

// 全局注册过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});
/* eslint-disable no-new */
permission({
  projectPath: 'haoban',
  whiteRoute: [ '/login', '/contactsList', '/apps', '/gic-error', '/403', '/404', '/500' ],
  router,
  routes,
  createApp() {
    /* eslint-disable no-new */
    new Vue({
      router,
      render: h => h(App)
    }).$mount('#app');
  }
});


