我的用户将收到一个链接,其中包含他们独有的密钥,可将他们引导至步骤表单。当他们进入步骤表单时,我想将他们自动重定向到 router.config 中的第一步。即他们将收到一个如下所示的网址:
https://example.com/register/user/sales?key=1234
他们必须被重定向到:
https://example.com/register/user/sales/account?key=1234
但是,一旦我的用户被重定向,查询参数“?key = 1234”就会丢失。我该如何解决?
我设置 router.config 如下:
export default [{
path: '/register',
component: '../layouts/RegisterLayout',
routes: [{
path: '/register',
redirect: '/register/user'
}, {
path: '/register/user',
name: 'user',
component: './Register/user'
}, {
path: '/register/user/:division',
name: 'user',
component: './Register/User',
hideChildrenInMenu: true,
routes: [{
path: '/register/user/:division',
redirect: '/register/user/:division/account'
}, {
path: '/register/user/:division/account',
name: 'account',
component: './Register/User/Step1CreateAccount'
}, {
path: '/register/user/:division/details',
name: 'details',
component: './Register/User/Step2UserDetails'
}]
}]
}]