From 1b69dce038d405bd5a7e271eea8dc2c946b39ab8 Mon Sep 17 00:00:00 2001 From: kmou424 Date: Wed, 31 Aug 2022 15:24:29 +0800 Subject: [PATCH] Fix: Support localhost domain and port in url --- js/set.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/set.js b/js/set.js index 6399194..2596ab6 100644 --- a/js/set.js +++ b/js/set.js @@ -1116,7 +1116,7 @@ $(document).ready(function () { // 自定义壁纸设置保存 $(".wallpaper_save").click(function () { var url = $("#wallpaper-url").val(); - var reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/; + var reg = /^http(s)?:\/\/(([\w-]+\.)+[\w-]|localhost)+(:[0-9]{1,5})?(\/[\w- ./?%&=]*)?$/g; if (!reg.test(url)) { iziToast.show({ message: '请输入正确的链接',