import Action from '@actions'; import UserCache from '@caches/UserCache'; import {getUser, inQb} from 'frc-core-pro'; import {loginPath} from '@constants/urls'; export const jumpLogin = (history?: any) => { if (history) { history.replace({pathname: loginPath}); return; } Action.replace({pathname: loginPath}); }; export const checkUserInQb = () => { if (!inQb() || !UserCache.user) { return; } getUser((user) => { if (UserCache.user.userId !== user.id) { UserCache.user = null; jumpLogin(); } }); };