Use the current domain if the api path is relative to the frontend host
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
08e44a4509
commit
50fe5d5ef2
|
@ -54,6 +54,9 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
apiDomain() {
|
||||
if (window.API_URL.startsWith('/api/v1')) {
|
||||
return window.location.host
|
||||
}
|
||||
const urlParts = window.API_URL.replace('http://', '').replace('https://', '').split(/[/?#]/)
|
||||
return urlParts[0]
|
||||
},
|
||||
|
@ -158,6 +161,7 @@ export default {
|
|||
this.successMsg = `Using Vikunja installation at "${this.apiDomain()}".`
|
||||
localStorage.setItem('API_URL', window.API_URL)
|
||||
this.configureApi = false
|
||||
this.apiUrl = window.API_URL
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
Reference in New Issue