浏览代码

FIX redirect after restart panel

Hamidreza Ghavami 1 年之前
父节点
当前提交
c7e300f14d
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      web/html/xui/settings.html

+ 6 - 1
web/html/xui/settings.html

@@ -480,7 +480,12 @@
                 if (msg.success) {
                     this.loading(true);
                     await PromiseUtil.sleep(5000);
-                    window.location.replace(this.allSetting.webBasePath + "panel/settings");
+                    let protocol = "http://";
+                    if (this.allSetting.webCertFile !== "") {
+                        protocol = "https://";
+                    }
+                    const { host, pathname } = window.location;
+                    window.location.replace(protocol + host + this.allSetting.webBasePath + pathname.slice(1));
                 }
             },
             async fetchUserSecret() {