Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit c2bd259

Browse files
authored
Merge pull request #11 from kmou424/master
Fix: Support localhost domain and port in url
2 parents a9110e9 + 1b69dce commit c2bd259

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/set.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ $(document).ready(function () {
11161116
// 自定义壁纸设置保存
11171117
$(".wallpaper_save").click(function () {
11181118
var url = $("#wallpaper-url").val();
1119-
var reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/;
1119+
var reg = /^http(s)?:\/\/(([\w-]+\.)+[\w-]|localhost)+(:[0-9]{1,5})?(\/[\w- ./?%&=]*)?$/g;
11201120
if (!reg.test(url)) {
11211121
iziToast.show({
11221122
message: '请输入正确的链接',

0 commit comments

Comments
 (0)