From ba920546337c5128ddaf5b9471b0dffc08c5190f Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 29 Dec 2023 09:51:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E8=A7=84=E5=88=99=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=89=B9=E6=AE=8A=E7=AC=A6=E5=8F=B7~!@$-=3D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/router-engine.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/router-engine.js b/src/router/router-engine.js index 5ac34cf..25c8b07 100644 --- a/src/router/router-engine.js +++ b/src/router/router-engine.js @@ -10,7 +10,7 @@ import { __ROUTER_VIEW__, ROUTE_CALLBACKS } from '../constants.js' //hash前缀正则 const PREFIX_REGEXP = /^(#!|#)[\/]+?/ -const RULE_REGEXP = /(\/[^/]*)(:[A-Za-z0-9_]+)(\?)?/g +const RULE_REGEXP = /(\/[^/]*)(:[\$@~\\!A-Za-z0-9_=\-]+)(\?)?/g const MODE_HASH = 'hash' const MODE_HISTORY = 'history' @@ -70,7 +70,7 @@ class Router { if (_prefix === '/') { _prefix = '/?' } - return _prefix + '([A-Za-z0-9_]+)' + _require + return _prefix + '([\\$\\!@~A-Za-z0-9_=\\-]+)' + _require } )