ant design pro dynamic routing for user rights control, but the route cannot jump to the specified page.
each re-login will cache the last requested route list, and the redirect address is also incorrect.
re-log in and take the route of the last login.
got the list of the last login inexplicably before requesting menu.
getBashRedirect = () = > {
// , url redirect
let { routerData } = this.props;
const urlParams = new URL(window.location.href);
const redirect = urlParams.searchParams.get("redirect");
if (redirect) {
urlParams.searchParams.delete("redirect");
window.history.replaceState(null, "redirect", urlParams.href);
} else {
const authorizedPath = Object.keys(routerData).find(
item => check(routerData[item].authority, item) && item !== "/"
);
console.log("authorizedPath", authorizedPath);
return authorizedPath;
}
return redirect;
};