From ad58785dc40b87421a8fd15a42fe4cfa9df0b53e Mon Sep 17 00:00:00 2001 From: imsyy Date: Thu, 1 Feb 2024 18:05:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BD=91=E5=9D=80=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/identifyInput.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/identifyInput.js b/src/utils/identifyInput.js index 98c6a85..f44d310 100644 --- a/src/utils/identifyInput.js +++ b/src/utils/identifyInput.js @@ -9,10 +9,8 @@ const identifyInput = (input) => { * 网址正则 * @type {RegExp} */ - const urlRegex = new RegExp( - "^(http://www.|https://www.|http://|https://)?[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(:[0-9]{1,5})?(/.*)?$", - ); - + const urlRegex = new RegExp("https?://[\\w.-]+", "i"); + /** * IP 正则 * @type {RegExp}