resolve baseurl problem

This commit is contained in:
Eric 2021-05-10 14:49:52 +03:00
parent f82b9d8ea5
commit 1837aa5cc6
6 changed files with 33 additions and 35 deletions

View file

@ -234,15 +234,13 @@ module.exports = {
}, },
copyToClipBoard(text) { copyToClipBoard(text) {
const getUrl = window.location; const getUrl = window.location;
let baseUrl =
getUrl.protocol + // let baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
"//" + // if (baseUrl.endsWith("/")) {
getUrl.host + // baseUrl = baseUrl.slice(0, -1);
"/" + // }
getUrl.pathname.split("/")[1];
if (baseUrl.endsWith("/")) { let baseUrl = getUrl.protocol + "//" + getUrl.host
baseUrl = baseUrl.slice(0, -1);
}
navigator.clipboard.writeText(`${baseUrl}${text}`).then( navigator.clipboard.writeText(`${baseUrl}${text}`).then(
function () { function () {

View file

@ -171,11 +171,11 @@
<script> <script>
const getUrl = window.location; const getUrl = window.location;
let baseUrl = // let baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1]; // if (baseUrl.endsWith("/")) {
if (baseUrl.endsWith("/")) { // baseUrl = baseUrl.slice(0, -1);
baseUrl = baseUrl.slice(0, -1); // }
} let baseUrl = getUrl.protocol + "//" + getUrl.host
module.exports = { module.exports = {
data() { data() {
return { return {

View file

@ -131,11 +131,11 @@
<script> <script>
const getUrl = window.location; const getUrl = window.location;
let baseUrl = // let baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1]; // if (baseUrl.endsWith("/")) {
if (baseUrl.endsWith("/")) { // baseUrl = baseUrl.slice(0, -1);
baseUrl = baseUrl.slice(0, -1); // }
} let baseUrl = getUrl.protocol + "//" + getUrl.host
module.exports = { module.exports = {
data() { data() {
return { return {

View file

@ -83,7 +83,7 @@
<img <img
alt="image" alt="image"
class="category-picture" class="category-picture"
v-bind:src="sondage.choices[0].img" src="assets/img/sondage.png"
/> />
</div> </div>
<div> <div>
@ -104,11 +104,11 @@
<script> <script>
const getUrl = window.location; const getUrl = window.location;
let baseUrl = // let baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1]; // if (baseUrl.endsWith("/")) {
if (baseUrl.endsWith("/")) { // baseUrl = baseUrl.slice(0, -1);
baseUrl = baseUrl.slice(0, -1); // }
} let baseUrl = getUrl.protocol + "//" + getUrl.host
module.exports = { module.exports = {
data() { data() {
return { return {

View file

@ -212,11 +212,11 @@
</style> </style>
<script> <script>
const getUrl = window.location; const getUrl = window.location;
let baseUrl = // let baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1]; // if (baseUrl.endsWith("/")) {
if (baseUrl.endsWith("/")) { // baseUrl = baseUrl.slice(0, -1);
baseUrl = baseUrl.slice(0, -1); // }
} let baseUrl = getUrl.protocol + "//" + getUrl.host
module.exports = { module.exports = {
data() { data() {
return { return {

View file

@ -313,11 +313,11 @@
<script> <script>
const getUrl = window.location; const getUrl = window.location;
let baseUrl = // let baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1]; // if (baseUrl.endsWith("/")) {
if (baseUrl.endsWith("/")) { // baseUrl = baseUrl.slice(0, -1);
baseUrl = baseUrl.slice(0, -1); // }
} let baseUrl = getUrl.protocol + "//" + getUrl.host
Vue.component("modal", { Vue.component("modal", {
template: "#modal-template", template: "#modal-template",
}); });