fix: 解决重定向路径 params 参数丢失问题
parent
764b0f0f6c
commit
7311bdb576
|
@ -40,6 +40,7 @@ export const useRedo = (_router?: Router) => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (name && Object.keys(params).length > 0) {
|
if (name && Object.keys(params).length > 0) {
|
||||||
|
params['_origin_params'] = JSON.stringify(params ?? {})
|
||||||
params['_redirect_type'] = 'name'
|
params['_redirect_type'] = 'name'
|
||||||
params['path'] = String(name)
|
params['path'] = String(name)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -36,7 +36,7 @@ export const REDIRECT_ROUTE: AppRouteRecordRaw = {
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/redirect/:path(.*)',
|
path: '/redirect/:path(.*)/:_redirect_type(.*)/:_origin_params(.*)',
|
||||||
name: REDIRECT_NAME,
|
name: REDIRECT_NAME,
|
||||||
component: () => import('@/views/base/redirect/index.vue'),
|
component: () => import('@/views/base/redirect/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
|
|
|
@ -19,7 +19,7 @@ if (_redirect_type === 'name') {
|
||||||
replace({
|
replace({
|
||||||
name: _path,
|
name: _path,
|
||||||
query,
|
query,
|
||||||
params
|
params: JSON.parse((params._origin_params as string) ?? '{}')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
replace({
|
replace({
|
||||||
|
|
Loading…
Reference in New Issue