From 4040f215d9b8f172c136cdfb22515ffa6693417b Mon Sep 17 00:00:00 2001 From: wanchun <445436867@qq.com> Date: Thu, 6 Apr 2023 11:19:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E5=A4=A7=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fes-preset-built-in/src/plugins/misc/route/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fes-preset-built-in/src/plugins/misc/route/index.js b/packages/fes-preset-built-in/src/plugins/misc/route/index.js index 9d92cb13..454c3e80 100644 --- a/packages/fes-preset-built-in/src/plugins/misc/route/index.js +++ b/packages/fes-preset-built-in/src/plugins/misc/route/index.js @@ -50,7 +50,7 @@ const getRouteName = function (parentRoutePath, fileName) { .replace(/\//g, '_') .replace(/@/g, '_') .replace(/\*/g, 'FUZZYMATCH') - .replace(/\[...([a-z]*)\]/, 'FUZZYMATCH-$1'); + .replace(/\[...([a-zA-Z]*)\]/, 'FUZZYMATCH-$1'); }; const getRoutePath = function (parentRoutePath, fileName, isFile = true) { @@ -67,8 +67,8 @@ const getRoutePath = function (parentRoutePath, fileName, isFile = true) { fileName = fileName.replace('*', ':pathMatch(.*)'); } // /[...slug].vue -> /:slug(.*) - if (/\[...[a-z]*\]/.test(fileName)) { - fileName = fileName.replace(/\[...([a-z]*)\]/, ':$1(.*)').replace(':(.*)', ':pathMatch(.*)'); + if (/\[...[a-zA-Z]*\]/.test(fileName)) { + fileName = fileName.replace(/\[...([a-zA-Z]*)\]/, ':$1(.*)').replace(':(.*)', ':pathMatch(.*)'); } return winPath(join(parentRoutePath, fileName)); };