InitialState = initialState; initialState = initialState; initialState = initialState;
const { initialState, setInitialState } = useModel('@@initialState');
So just use this code in the logon logic:
Import {R_Menu} from '@/services/builder'; // import SystemRoutes from '@/.. /config/routes';
Const FetchUserInfo = async () => {const UserInfo = await InitialState? .fetchUserInfo? . (); If (userInfo) {const menu = await R_Menu(); await R_Menu(); // Merge SystemRoutes & Business Menu const FreshMenu = SystemRoutes.concat(menu); // Overwrite the system's current route setInitialState({... initialState, menuData: freshMenu, currentUser: userInfo, }); }};