From 3f3035fbb84de7bdeb1bbc868608f21ca11c1dd6 Mon Sep 17 00:00:00 2001 From: zhenAri <516039511@qq.com> Date: Sat, 10 Jun 2023 15:08:46 +0800 Subject: [PATCH] =?UTF-8?q?vuerouter4.1.4=E6=9B=B4=E6=96=B0=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=B7=AF=E7=94=B1=E7=BC=93=E5=AD=98=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=87=BA=E7=8E=B0404=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/web/usePage.ts | 2 +- src/views/sys/redirect/index.vue | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hooks/web/usePage.ts b/src/hooks/web/usePage.ts index d6df000..c9fb0d0 100644 --- a/src/hooks/web/usePage.ts +++ b/src/hooks/web/usePage.ts @@ -60,7 +60,7 @@ export const useRedo = (_router?: Router) => { params['_redirect_type'] = 'path'; params['path'] = fullPath; } - push({ name: REDIRECT_NAME, params, query }).then(() => resolve(true)); + push({ name: REDIRECT_NAME, state: { params }, query }).then(() => resolve(true)); }); } return redo; diff --git a/src/views/sys/redirect/index.vue b/src/views/sys/redirect/index.vue index 7aa5463..9632d6c 100644 --- a/src/views/sys/redirect/index.vue +++ b/src/views/sys/redirect/index.vue @@ -5,9 +5,10 @@ import { unref } from 'vue'; import { useRouter } from 'vue-router'; - const { currentRoute, replace } = useRouter(); + const { currentRoute, replace, options } = useRouter(); - const { params, query } = unref(currentRoute); + const { query } = unref(currentRoute); + const { params } = options.history.state as Recordable; const { path, _redirect_type = 'path' } = params; Reflect.deleteProperty(params, '_redirect_type');