feat(Router): 路由跳转携带参数 (#720)

Co-authored-by: suxue <admin@moyiyang.cn>
This commit is contained in:
Suxue 2024-05-21 10:33:39 +08:00 committed by GitHub
parent 0aa81be9a6
commit 6e0560f69d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,7 +39,7 @@ router.beforeEach(async (to, from, next) => {
next({ path: to.fullPath, replace: true, query: to.query });
} else {
const redirect = decodeURIComponent((from.query.redirect || to.path) as string);
next(to.path === redirect ? { ...to, replace: true } : { path: redirect });
next(to.path === redirect ? { ...to, replace: true } : { path: redirect, query: to.query });
return;
}
}