import { createApp } from 'vue'
import './style.css'
import * as echarts from 'echarts';
import axios from 'axios';
import { s3Layer } from 'vue3-layer';
import 'vue3-layer/dist/s3Layer.css';
import App from './App.vue'

const createEcharts = {
    install(app, options) {
        app.provide('echarts', echarts);
    }
}
const createAxios = {
    install(app, options) {
        axios.defaults.baseURL = 'http://219.147.99.164:8082/datahouse/';
        axios.defaults.timeout = 20000;
        axios.defaults.headers.common['PKEY'] = 'a0a25c1e-818a-489e-98c0-0f3a282a49d2';
        axios.defaults.headers.common['PPASS'] = '5be81fdf-2c5d-4ee6-ae45-ffe82b5db2ff';
        app.provide('axios', axios);
    }
}
const createCommon = {
    install(app, options) {
        app.provide('common', {
            getPageBaseUrl() {
                return '/population/'
            }
        })
    }
}

const app = createApp(App);
app.use(createEcharts);
app.use(createAxios);
app.use(createCommon)
app.component('s3-layer', s3Layer);
app.mount('#app');
