fix urls + use the new buildURL func

This commit is contained in:
Hamidreza Ghavami
2023-05-31 03:39:41 +04:30
parent 8bf6604ed6
commit 8f4fb47e27
6 changed files with 23 additions and 35 deletions

View File

@@ -432,7 +432,7 @@
this.loading(false);
if (msg.success) {
this.user = {};
window.location.replace(basePath + "logout")
window.location.replace(basePath + "logout");
}
},
async restartPanel() {
@@ -451,12 +451,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 + "xui/settings");
const { webCertFile, webKeyFile, webDomain: host, webPort: port, webBasePath: base } = this.allSetting;
const isTLS = webCertFile !== "" || webKeyFile !== "";
const url = buildURL({ host, port, isTLS, base, path: "xui/settings" });
window.location.replace(url);
}
},
async resetXrayConfigToDefault() {