Skip to content
Snippets Groups Projects
main.js 1.18 KiB
Newer Older
const axios = require("axios")
import Vue from 'vue'

import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import 'leaflet/dist/leaflet.css';
import 'leaflet-draw/dist/leaflet.draw.css';
import '@/assets/resources/leaflet-control-geocoder-1.13.0/Control.Geocoder.css';
Vue.config.productionTip = false


axios.get("/config/config.json")
  .then((response) => {
    if (response && response.status === 200) {
            store.commit("SET_CONFIG", response.data);
            window.proxy_url=response.data.VUE_APP_DJANGO_API_BASE+"proxy/"
            axios.all([store.dispatch("USER_INFO"),
              store.dispatch("GET_ALL_PROJECTS"),
              store.dispatch("GET_STATIC_PAGES"),
              store.dispatch("GET_USER_LEVEL_PROJECTS"),
              store.dispatch("map/GET_LAYERS"),
              store.dispatch("GET_USER_LEVEL_PERMISSIONS"),
            ]).then(axios.spread(function () {
              new Vue({
                router,
                store,
                render: h => h(App)
              }).$mount('#app')
            }))
          }
        })
        .catch((error) => {
          throw error;
  });