diff --git a/.gitignore b/.gitignore index e2aac05..a76bd32 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ src/.umi-production/ EMBED_INTEGRATION.md embed-debug.html sdk_dist -package-lock.json \ No newline at end of file +package-lock.json diff --git a/src/app.tsx b/src/app.tsx index de3f0be..2824777 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -20,15 +20,23 @@ import { patchRouteWithRemoteMenus, setRemoteMenu, } from './services/session'; +import { + fetchAndUpdateBadge, + patchMenuBadge, + clearBadgeCount, +} from './services/Management/interviewBadge'; import { PageEnum } from './enums/pagesEnums'; import { stringify } from 'querystring'; import { message } from 'antd'; +import React from 'react'; import { getProductionApiBaseUrl } from './utils/publicUrl'; const isDev = process.env.NODE_ENV === 'development'; + const loginOut = async () => { clearSessionToken(); setRemoteMenu(null); + clearBadgeCount(); const { search, pathname } = window.location; const urlParams = new URL(window.location.href).searchParams; /** 此方法会跳转到 redirect 参数所在的位置 */ @@ -112,6 +120,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = // content: initialState?.currentUser?.nickName, }, // actionRef: layoutActionRef, + postMenuData: (menuData: any[]) => patchMenuBadge(menuData), menu: { locale: false, // // 每当 initialState?.currentUser?.userid 发生修改时重新执行 request @@ -122,7 +131,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = if (!initialState?.currentUser?.userId) { return []; } - return getRemoteMenu(); + return getRemoteMenu() || []; }, }, footerRender: () =>