fix urls + use the new buildURL func

This commit is contained in:
Hamidreza Ghavami
2023-05-31 01:47:07 +04:30
parent 1c9fc9422e
commit b203067dfd
6 changed files with 23 additions and 33 deletions

View File

@@ -523,7 +523,7 @@
this.loading(false);
if (msg.success) {
this.user = {};
window.location.replace(basePath + "logout")
window.location.replace(basePath + "logout");
}
},
async restartPanel() {
@@ -542,12 +542,10 @@
if (msg.success) {
this.loading(true);
await PromiseUtil.sleep(5000);
let protocol = "http://";
if (this.allSetting.webCertFile !== "") {
protocol = "https://";
}
const { host } = window.location;
window.location.replace(protocol + host + this.allSetting.webBasePath + "panel/settings");
const { webCertFile, webKeyFile, webDomain: host, webPort: port, webBasePath: base } = this.allSetting;
const isTLS = webCertFile !== "" || webKeyFile !== "";
const url = buildURL({ host, port, isTLS, base, path: "panel/settings" });
window.location.replace(url);
}
},
async fetchUserSecret() {