1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2025-12-06 14:52:50 +08:00

fix: hostname 不允许填 127.0.0.1 和 localhost

This commit is contained in:
涵曦
2025-12-01 22:37:46 +08:00
parent 474a29caf0
commit c0a0571094

View File

@@ -205,6 +205,9 @@ $(function () {
$("#auto-hostname").on("click", () => {
const protocol = window.location.protocol;
const hostname = window.location.hostname;
if (hostname == '127.0.0.1' || hostname == 'localhost') {
alert("hostname 不能是 127.0.0.1 或者 localhost");
}
const baseUrl = `${protocol}//${hostname}`;
console.log(baseUrl);
$("#hostname").val(baseUrl);