From 513ccb954317c9cbe2d1697cbeb0720669496781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Sat, 29 Oct 2022 10:35:36 +0800 Subject: [PATCH] fix(route): url with hash not work. fixed #2301 #1311 #1253 --- src/utils/is.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/is.ts b/src/utils/is.ts index 0252aa0c..4e7934a1 100644 --- a/src/utils/is.ts +++ b/src/utils/is.ts @@ -93,7 +93,6 @@ export const isServer = typeof window === 'undefined'; export const isClient = !isServer; export function isUrl(path: string): boolean { - const reg = - /^(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?(\/#\/)?(?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; + const reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/; return reg.test(path); }