From 86e70a38d02e401aa569e3e26a28ebe0c474c0b2 Mon Sep 17 00:00:00 2001 From: francis-fh Date: Mon, 20 Jul 2026 20:50:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=A7=92=E6=A0=87=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- src/app.tsx | 12 +++- src/pages/Management/InterviewList/index.tsx | 2 + src/services/Management/interviewBadge.tsx | 72 ++++++++++++++++++++ src/services/Management/list.ts | 13 ++++ 5 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 src/services/Management/interviewBadge.tsx 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: () =>