From 7311bdb576ff49b52fcb0381eb700144f2ad5af7 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 10 May 2023 18:37:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=87=8D=E5=AE=9A?= =?UTF-8?q?=E5=90=91=E8=B7=AF=E5=BE=84=20params=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/web/usePage.ts | 1 + src/router/routes/basic.ts | 2 +- src/views/base/redirect/index.vue | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/web/usePage.ts b/src/hooks/web/usePage.ts index e9176fb4..4032cc92 100644 --- a/src/hooks/web/usePage.ts +++ b/src/hooks/web/usePage.ts @@ -40,6 +40,7 @@ export const useRedo = (_router?: Router) => { return } if (name && Object.keys(params).length > 0) { + params['_origin_params'] = JSON.stringify(params ?? {}) params['_redirect_type'] = 'name' params['path'] = String(name) } else { diff --git a/src/router/routes/basic.ts b/src/router/routes/basic.ts index 3a9614c0..b6671c3d 100644 --- a/src/router/routes/basic.ts +++ b/src/router/routes/basic.ts @@ -36,7 +36,7 @@ export const REDIRECT_ROUTE: AppRouteRecordRaw = { }, children: [ { - path: '/redirect/:path(.*)', + path: '/redirect/:path(.*)/:_redirect_type(.*)/:_origin_params(.*)', name: REDIRECT_NAME, component: () => import('@/views/base/redirect/index.vue'), meta: { diff --git a/src/views/base/redirect/index.vue b/src/views/base/redirect/index.vue index d031daf6..336ba90b 100644 --- a/src/views/base/redirect/index.vue +++ b/src/views/base/redirect/index.vue @@ -19,7 +19,7 @@ if (_redirect_type === 'name') { replace({ name: _path, query, - params + params: JSON.parse((params._origin_params as string) ?? '{}') }) } else { replace({