diff --git a/public/config/config.json b/public/config/config.json index 729d914f4468eee39121a36acb68e0db2478181b..859464c3401983ee073000a70601cb67c0223024 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,5 +1,5 @@ { - "BASE_URL":"/", + "BASE_URL":"/geocontrib/", "DOMAIN":"http://localhost:8010/", "NODE_ENV":"development", "VUE_APP_LOCALE":"fr-FR", diff --git a/src/main.js b/src/main.js index 724a17140dc042cedd811c9027eb374e807a067d..5fee434701c981d8b905fc0b2894c0f3e27b73d5 100644 --- a/src/main.js +++ b/src/main.js @@ -14,25 +14,26 @@ 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_AVAILABLE_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; + 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_AVAILABLE_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; }); diff --git a/src/router/index.js b/src/router/index.js index cf769571958b7f1c75195b7157bcad0f22062e3b..035bafb0d27e113d77fab3d5fc207db3050e7356 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -120,7 +120,7 @@ const routes = [ const router = new VueRouter({ mode: 'history', - base: process.env.BASE_URL, + base: '/geocontrib/', routes, routerHistory: [], scrollBehavior(to, from, savedPosition) { //* record each route change to turn back to origin after redirect diff --git a/vue.config.js b/vue.config.js index d10ca3e244f7d2a3e154a975710d6b71870fe5b0..cf99b52a073c9fd1a448cc4c34aa40558f263172 100644 --- a/vue.config.js +++ b/vue.config.js @@ -3,14 +3,15 @@ const fs = require('fs') const packageJson = fs.readFileSync('./package.json') const version = JSON.parse(packageJson).version || 0 module.exports = { - configureWebpack: { - plugins: [ - new webpack.DefinePlugin({ - 'process.env': { - PACKAGE_VERSION: '"' + version + '"' - } - }) - ] - }, -// the rest of your original module.exports code goes here + publicPath: '/geocontrib/', + configureWebpack: { + plugins: [ + new webpack.DefinePlugin({ + 'process.env': { + PACKAGE_VERSION: '"' + version + '"' + } + }) + ] + }, + // the rest of your original module.exports code goes here } \ No newline at end of file