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:
3
xiaomusic/static/default/setting.js
vendored
3
xiaomusic/static/default/setting.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user