From 8f231bc296eccdccb36ae1d03f18930862d67088 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 17 Sep 2024 15:44:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=8F=9C=E5=8D=95=E7=9A=84=E8=B7=AF=E7=94=B1=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E4=B8=BA=E9=93=BE=E6=8E=A5=E6=97=B6=E4=B8=8D=E5=B8=A6?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/routerHelper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/routerHelper.ts b/src/utils/routerHelper.ts index 6dcba9af..83aa39ef 100644 --- a/src/utils/routerHelper.ts +++ b/src/utils/routerHelper.ts @@ -88,7 +88,8 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord // 2. 生成 data(AppRouteRecordRaw) // 路由地址转首字母大写驼峰,作为路由名称,适配keepAlive let data: AppRouteRecordRaw = { - path: route.path.indexOf('?') > -1 && !route.path.startsWith('http') ? route.path.split('?')[0] : route.path, + path: + route.path.indexOf('?') > -1 && !isUrl(route.path) ? route.path.split('?')[0] : route.path, // 注意,需要排除 http 这种 url,避免它带 ? 参数被截取掉 name: route.componentName && route.componentName.length > 0 ? route.componentName