fix baseUrl problem

This commit is contained in:
ArenMg 2021-05-08 11:08:21 +03:00
parent 44d74afc91
commit 7a7344e50a
6 changed files with 38 additions and 28 deletions

View File

@ -234,12 +234,16 @@ module.exports = {
},
copyToClipBoard(text) {
const getUrl = window.location;
const baseUrl =
let baseUrl =
getUrl.protocol +
"//" +
getUrl.host +
"/" +
getUrl.pathname.split("/")[1];
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, -1);
}
navigator.clipboard.writeText(`${baseUrl}${text}`).then(
function () {
alert("lien copié dans le presse-papier");

View File

@ -171,8 +171,11 @@
<script>
const getUrl = window.location;
const baseUrl =
let baseUrl =
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, -1);
}
module.exports = {
data() {
return {
@ -236,9 +239,9 @@ module.exports = {
url: `${baseUrl}/ws/agenda/calendars/${this.$route.query.id}`,
data: this.editionProgram,
});
console.log(success)
console.log(success);
swal("Succès!", "L'agenda a été modifié", "success").then((value) => {
this.program = {...this.editionProgram}
this.program = { ...this.editionProgram };
this.isEditMode = false;
});
} catch (error) {

View File

@ -67,7 +67,6 @@
</div>
</template>
<style scoped>
.box-container {
border: 1px solid #a1a3a1;
@ -130,11 +129,13 @@
}
</style>
<script>
const getUrl = window.location;
const baseUrl =
let baseUrl =
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, -1);
}
module.exports = {
data() {
return {
@ -170,7 +171,7 @@ module.exports = {
date: selectedDate,
},
});
console.log(resp)
console.log(resp);
this.name = "";
this.text = "";
@ -179,7 +180,6 @@ module.exports = {
this.selectedDate = new Date();
swal("Succès!", "L'agenda a été créé", "success");
} catch (error) {
swal("Erreur!", `${error}`, "error");
console.error(error);
@ -187,4 +187,4 @@ module.exports = {
},
},
};
</script>
</script>

View File

@ -56,17 +56,14 @@
<img
alt="image"
class="category-picture"
src='assets/img/calendar.png'
src="assets/img/calendar.png"
/>
</div>
<div>
<h2 v-bind:title="program.title">{{ program.title }}</h2>
</div>
<div class="card-footer light-color">
<span
>Le
{{ new Date(program.date).toLocaleString() }}</span
>
<span>Le {{ new Date(program.date).toLocaleString() }}</span>
</div>
</router-link>
</div>
@ -107,8 +104,11 @@
<script>
const getUrl = window.location;
const baseUrl =
let baseUrl =
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, -1);
}
module.exports = {
data() {
return {
@ -151,4 +151,4 @@ module.exports = {
},
},
};
</script>
</script>

View File

@ -65,9 +65,7 @@
@click="vote(subtheme, `NEUTRAL`)"
v-if="checkVoteAvalaibility(subtheme.id)"
>
<span
>Participation possible | {{ subtheme.neutral }}</span
>
<span>Participation possible | {{ subtheme.neutral }}</span>
</button>
</td>
</tr>
@ -88,7 +86,9 @@
:key="subtheme.id"
class="text-centered"
>
<span class="nb-total-vote">{{ subtheme.for }} participant(s) </span>
<span class="nb-total-vote"
>{{ subtheme.for }} participant(s)
</span>
</td>
</tr>
</table>
@ -212,8 +212,11 @@
</style>
<script>
const getUrl = window.location;
const baseUrl =
let baseUrl =
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, -1);
}
module.exports = {
data() {
return {
@ -276,7 +279,7 @@ module.exports = {
(el) => el.subThemeId.id || el.subThemeId
);
const arr = filteredBySubTheme.filter(el => el == _subthemeId);
const arr = filteredBySubTheme.filter((el) => el == _subthemeId);
return arr.length <= 0;
},

View File

@ -241,11 +241,9 @@
</button>
</div>
</base-layout>
</div>
</template>
<style scoped>
.box-container {
border: 1px solid #a1a3a1;
@ -313,11 +311,13 @@
}
</style>
<script>
const getUrl = window.location;
const baseUrl =
let baseUrl =
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, -1);
}
Vue.component("modal", {
template: "#modal-template",
});
@ -469,4 +469,4 @@ module.exports = {
},
},
};
</script>
</script>