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({