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) { copyToClipBoard(text) {
const getUrl = window.location; const getUrl = window.location;
const baseUrl = let baseUrl =
getUrl.protocol + getUrl.protocol +
"//" + "//" +
getUrl.host + getUrl.host +
"/" + "/" +
getUrl.pathname.split("/")[1]; getUrl.pathname.split("/")[1];
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, -1);
}
navigator.clipboard.writeText(`${baseUrl}${text}`).then( navigator.clipboard.writeText(`${baseUrl}${text}`).then(
function () { function () {
alert("lien copié dans le presse-papier"); alert("lien copié dans le presse-papier");

View file

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

View file

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

View file

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

View file

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

View file

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