From 9b08f2ea3ee954bc9afb4fc863de6ee41da65c93 Mon Sep 17 00:00:00 2001 From: zhiyan Date: Thu, 21 Jun 2018 11:29:14 +0800 Subject: [PATCH] fix: isUrl func failed && support judge url with port --- src/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index 9700b31e..5385e42f 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -162,7 +162,7 @@ export function getRoutes(path, routerData) { } /* eslint no-useless-escape:0 */ -const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/g; +const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; export function isUrl(path) { return reg.test(path); -- GitLab