From c2254304cad9e2aca659de20a0671d40604b716c Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 30 Mar 2026 16:07:05 +0800 Subject: [PATCH] fix: correct useLocation import from @umijs/max --- src/common/components/layout/CustomHeader.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/components/layout/CustomHeader.tsx b/src/common/components/layout/CustomHeader.tsx index f3106ae..247ebb1 100644 --- a/src/common/components/layout/CustomHeader.tsx +++ b/src/common/components/layout/CustomHeader.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Layout, Dropdown } from 'antd'; import type { MenuProps } from 'antd'; -import { history } from '@umijs/max'; +import { useLocation } from '@umijs/max'; import AvatarProps from './AvatarProps'; import { useMyState } from '@/common'; @@ -14,7 +14,7 @@ interface CustomHeaderProps { export const CustomHeader: React.FC = ({ collapsed, toggle }) => { const { snap } = useMyState(); - const { pathname } = history.useLocation(); + const { pathname } = useLocation(); // 在登录页面不显示header if (pathname === '/login') {