diff --git a/src/store/index.js b/src/store/index.js index 64791f0a7a06b86f164c2d088c9f13daf3dc115c..225a436baf70bef89896a64b107a05b8ab33f0c1 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -179,6 +179,7 @@ export default new Vuex.Store({ }, LOGOUT({ commit }) { + const pageNoRedirect = ["liste-signalements", "details-type-signalement", "details-signalement", "project_detail", "mentions", "aide", "index"] axios .get(`${this.state.configuration.VUE_APP_DJANGO_API_BASE}logout/`) .then((response) => { @@ -186,7 +187,7 @@ export default new Vuex.Store({ commit("SET_USER", false); commit("SET_USER_LEVEL_PROJECTS", null); commit("SET_USER_PERMISSIONS", null); - router.push("/"); + if (!pageNoRedirect.includes(router.history.current.name)) router.push("/"); } }) .catch((error) => { diff --git a/src/views/flatpages/Default.vue b/src/views/flatpages/Default.vue index af38296848360fd63ff2959cb145688a120ce05a..9c8443814c424080936686fbc796b77fc955070d 100644 --- a/src/views/flatpages/Default.vue +++ b/src/views/flatpages/Default.vue @@ -1,7 +1,6 @@ <template> <div v-if="flatpage" class="row"> <div class="ten wide column"> - {{ this.$route.params.url }} <h1>{{ flatpage.title }}</h1> <div v-html="flatpage.content"></div> </div> @@ -9,13 +8,17 @@ </template> <script> +import { mapState } from "vuex"; + export default { name: "Default", + computed: { + ...mapState(["staticPages"]), flatpage() { - if (this.$store.state.staticPages) { - return this.$store.state.staticPages.find( - (page) => page.url === this.$route.path + if (this.staticPages) { + return this.staticPages.find( + (page) => page.url === `/${this.$route.name}/` ); } return null; diff --git a/src/views/flatpages/with_right_menu.vue b/src/views/flatpages/with_right_menu.vue index 645789602cf33c1172b03956d752edc0d29ed58f..c04a20b34a1990deba6f54b482f0eb40f0ec27c7 100644 --- a/src/views/flatpages/with_right_menu.vue +++ b/src/views/flatpages/with_right_menu.vue @@ -23,18 +23,23 @@ </template> <script> +import { mapState } from "vuex"; + export default { name: "With_right_menu", + data() { return { sections: [], }; }, + computed: { + ...mapState(["staticPages"]), flatpage() { - if (this.$store.state.staticPages) { - return this.$store.state.staticPages.find( - (page) => page.url === this.$route.path + if (this.staticPages) { + return this.staticPages.find( + (page) => page.url === `/${this.$route.name}/` ); } return null;