diff --git a/web/html/settings.html b/web/html/settings.html index 722dc64f..20fa238e 100644 --- a/web/html/settings.html +++ b/web/html/settings.html @@ -322,8 +322,9 @@ const { webDomain, webPort, webBasePath, webCertFile, webKeyFile } = this.allSetting; const newProtocol = (webCertFile || webKeyFile) ? "https:" : "http:"; + const base = webBasePath ? webBasePath.replace(/^\//, "") : ""; + if (!this.entryIsIP) { - const base = webBasePath ? webBasePath.replace(/^\//, "") : ""; const url = new URL(window.location.href); url.pathname = `/${base}panel/settings`; window.location.replace(url.toString()); @@ -341,8 +342,6 @@ finalPort = String(webPort); } - const base = webBasePath ? webBasePath.replace(/^\//, "") : ""; - const url = new URL(`${newProtocol}//${finalHost}`); if (finalPort) url.port = finalPort; url.pathname = `/${base}panel/settings`;