import "babel-polyfill"; // 解决Ie9
import Vue from "vue";
import App from './App.vue'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import router from "./router/index";
import store from "./store/index";
import "./element";
import * as filters from "./filtres/index"; // 全局过滤器
import "./role"; // 权限
import allTools from "./plugin/allTools";
// import Print from './plugin/print';
import VueClipboard from 'vue-clipboard2'
// import "./mock"; // 模拟数据

import "./assets/icons/iconfont";
import IconSvg from "./components/common/IconSvg.vue"; // svg组件
import {parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree} from "@/utils/ruoyi";

import {getUUID} from "@/utils/strUtil";
import axios from "axios";
import "../public/config.json";
import myReq from "./utils/axios"
// 注册全局组件（register global）
Vue.component("icon-svg", IconSvg);
axios.defaults.withCredentials = true
// 注册全局实用程序过滤器（register global utility filters）.
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key]);
});
Vue.use(allTools);
Vue.use(ElementUI);
Vue.use(VueClipboard)
Vue.config.productionTip = false;

Vue.prototype.getUUID = getUUID
Vue.prototype.parseTime = parseTime

let getUrl = "";
let startApp = function () {
    axios.get('./config.json').then((res) => {
        // 基础地址
        getUrl = res.data.BASE_URL;
        myReq.defaults.baseURL = getUrl;

        new Vue({
            router,
            store,
            render: h => h(App)
        }).$mount("#app");
    });
};

startApp();

