修改未登录访问需要登录的资源,在登录后重定向丢失请求参数问题
This commit is contained in:
parent
a9196bbdf7
commit
c5fe5bf3cb
|
@ -118,7 +118,14 @@ function handleLogin() {
|
|||
}
|
||||
// 调用action的登录方法
|
||||
userStore.login(loginForm.value).then(() => {
|
||||
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(() => {
|
||||
loading.value = false;
|
||||
// 重新获取验证码
|
||||
|
|
Loading…
Reference in New Issue