Commit afacf688250ed11466d809e3f5d43d71ef81306b
Committed by
GitHub
1 parent
60a3b6a9
fix: 解决重定向路径 params 参数丢失问题 (#2753)
Co-authored-by: kelvin <kyun.wang@jodoinc.com>
Showing
3 changed files
with
3 additions
and
2 deletions
src/hooks/web/usePage.ts
@@ -40,6 +40,7 @@ export const useRedo = (_router?: Router) => { | @@ -40,6 +40,7 @@ export const useRedo = (_router?: Router) => { | ||
40 | return; | 40 | return; |
41 | } | 41 | } |
42 | if (name && Object.keys(params).length > 0) { | 42 | if (name && Object.keys(params).length > 0) { |
43 | + params['_origin_params'] = JSON.stringify(params ?? {}); | ||
43 | params['_redirect_type'] = 'name'; | 44 | params['_redirect_type'] = 'name'; |
44 | params['path'] = String(name); | 45 | params['path'] = String(name); |
45 | } else { | 46 | } else { |
src/router/routes/basic.ts
@@ -42,7 +42,7 @@ export const REDIRECT_ROUTE: AppRouteRecordRaw = { | @@ -42,7 +42,7 @@ export const REDIRECT_ROUTE: AppRouteRecordRaw = { | ||
42 | }, | 42 | }, |
43 | children: [ | 43 | children: [ |
44 | { | 44 | { |
45 | - path: '/redirect/:path(.*)', | 45 | + path: '/redirect/:path(.*)/:_redirect_type(.*)/:_origin_params(.*)', |
46 | name: REDIRECT_NAME, | 46 | name: REDIRECT_NAME, |
47 | component: () => import('/@/views/sys/redirect/index.vue'), | 47 | component: () => import('/@/views/sys/redirect/index.vue'), |
48 | meta: { | 48 | meta: { |
src/views/sys/redirect/index.vue