修改未登录访问需要登录的资源,在登录后重定向丢失请求参数问题

This commit is contained in:
RuoYi 2023-08-31 11:47:54 +08:00
parent a9196bbdf7
commit c5fe5bf3cb
1 changed files with 8 additions and 1 deletions

View File

@ -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;
//