Ant design pro starts after the default is to open the page is logged in, how to set it to open after startup is the login page!

after Ant design pro starts, the default is to open the page after login, how to set it to open after startup is the login page!

Mar.28,2021

1. Plan 1, configure routing, set the home page to login page
2. Plan 2: make a judgment on the home page. If you are not logged in, jump to the login page


just change the default permission in the util/authority.js file to 'guest'.

export function getAuthority() {
  // return localStorage.getItem('antd-pro-authority') || ['admin', 'user'];
  return localStorage.getItem('antd-pro-authority') || 'guest';  //guest.
}

export function setAuthority(authority) {
  return localStorage.setItem('antd-pro-authority', authority);
}
Menu