⚡优化未登录访问需要登录的资源,在登录后重定向丢失请求参数问题
This commit is contained in:
parent
e1879c706c
commit
43485dddfa
@ -143,7 +143,14 @@ function handleLogin() {
|
||||
.login(loginForm.value)
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess(proxy.$t('login.loginSuccess'))
|
||||
router.push({ path: redirect.value || '/' })
|
||||
const query = route.query
|
||||
const otherQueryParams = Object.keys(query).reduce((acc, cur) => {
|
||||
if (cur !== 'redirect') {
|
||||
acc[cur] = query[cur]
|
||||
}
|
||||
return acc
|
||||
}, {})
|
||||
router.push({ path: redirect.value || '/', query: otherQueryParams })
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user