Merge pull request #11 from kmou424/master

Fix: Support localhost domain and port in url
This commit is contained in:
底层用户 2022-09-01 09:24:16 +08:00 committed by GitHub
commit c2bd259140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: '请输入正确的链接',