Skip to content

Commit

Permalink
Fix: Support localhost domain and port in url
Browse files Browse the repository at this point in the history
  • Loading branch information
kmou424 committed Aug 31, 2022
1 parent a9110e9 commit 1b69dce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '请输入正确的链接',
Expand Down

0 comments on commit 1b69dce

Please sign in to comment.