Login bug fix for OOP and module bundling architecture complete.

This commit is contained in:
2024-09-17 17:21:01 +01:00
parent 47e149c88f
commit d37f632c92
6 changed files with 16 additions and 14 deletions

View File

@@ -40,18 +40,19 @@ export default class API {
if (hash == null) hash = hashPageHome;
console.log("getUrlFromHash:");
console.log("base url: " + _pathHost + "\nhash: " + hash + '\nparams: ' + params);
let url = _pathHost + hash;
if (params) {
url += '?' + new URLSearchParams(params).toString();
}
let url = API.parameteriseUrl(_pathHost + hash, params);
console.log("url: " + url);
return url;
}
static parameteriseUrl(url, params) {
if (params) {
url += '?' + new URLSearchParams(params).toString();
}
return url;
}
static goToUrl(url) {
window.location.href = url;
}
static goToHash(hash, params = null) {
const url = API.getUrlFromHash(hash, params);
API.goToUrl(url);