mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-06 16:00:28 +01:00
Update fetch.js
Fixed for running over HTTPS
This commit is contained in:
parent
a30843cff9
commit
0489dc7c33
@ -19,7 +19,8 @@ const getUrl = (url) => {
|
|||||||
if (apiKey){
|
if (apiKey){
|
||||||
return `${apiKey.host}${url}`
|
return `${apiKey.host}${url}`
|
||||||
}
|
}
|
||||||
return `//${window.location.host}${window.location.pathname}${url}`
|
return window.location.hostname === 'localhost' ? url
|
||||||
|
: `${window.location.protocol}//${window.location.host}${window.location.pathname}${url}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fetchGet = async (url, params=undefined, callback=undefined) => {
|
export const fetchGet = async (url, params=undefined, callback=undefined) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user