Ant design pro route redirection error

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.

clipboard.png
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;

};

Mar.25,2021

has been solved. Every time you log in again, you can empty the menu routerData stored in props

.
Menu