From 52fffd9be8859e8c69be93145f072b9af7af8b78 Mon Sep 17 00:00:00 2001 From: mathias Date: Mon, 30 Oct 2023 19:33:06 +0100 Subject: [PATCH] changement chemin absolu a relatif --- frontend-vue/src/components/DailyCity.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend-vue/src/components/DailyCity.vue b/frontend-vue/src/components/DailyCity.vue index 55993d6..fc79733 100644 --- a/frontend-vue/src/components/DailyCity.vue +++ b/frontend-vue/src/components/DailyCity.vue @@ -11,14 +11,13 @@ export default { data() { return { imgDailyCity: "", - apiBaseUrl: "http://localhost/api/", - apiGetDailyCity: "ville/today" + apiGetDailyCity: "/api/ville/today" }; }, methods: { getCity() { try { - axios.get(this.apiBaseUrl + this.apiGetDailyCity).then((response) => { + axios.get(window.location.origin.replace(/:\d+$/, '') + this.apiGetDailyCity).then((response) => { (this.imgDailyCity = response.data.img) }) } catch (err) {