fix: When defaultHomePage is inconsistent with user.homePath, the pa… (#6299)
* fix: When defaultHomePage is inconsistent with user.homePath, the page refresh route jump will be abnormal * fix: When defaultHomePage is inconsistent with user.homePath, the page refresh route jump will be abnormal
This commit is contained in:
parent
78c3c9da6f
commit
76d106e474
@ -105,11 +105,16 @@ function setupAccessGuard(router: Router) {
|
|||||||
accessStore.setAccessMenus(accessibleMenus);
|
accessStore.setAccessMenus(accessibleMenus);
|
||||||
accessStore.setAccessRoutes(accessibleRoutes);
|
accessStore.setAccessRoutes(accessibleRoutes);
|
||||||
accessStore.setIsAccessChecked(true);
|
accessStore.setIsAccessChecked(true);
|
||||||
const redirectPath = (from.query.redirect ??
|
let redirectPath: string;
|
||||||
(to.path === preferences.app.defaultHomePath
|
if (from.query.redirect) {
|
||||||
? userInfo.homePath || preferences.app.defaultHomePath
|
redirectPath = from.query.redirect as string;
|
||||||
: to.fullPath)) as string;
|
} else if (to.path === preferences.app.defaultHomePath) {
|
||||||
|
redirectPath = preferences.app.defaultHomePath;
|
||||||
|
} else if (userInfo.homePath && to.path === userInfo.homePath) {
|
||||||
|
redirectPath = userInfo.homePath;
|
||||||
|
} else {
|
||||||
|
redirectPath = to.fullPath;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
...router.resolve(decodeURIComponent(redirectPath)),
|
...router.resolve(decodeURIComponent(redirectPath)),
|
||||||
replace: true,
|
replace: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user