develop #30
@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Layout, Dropdown } from 'antd';
|
import { Layout, Dropdown } from 'antd';
|
||||||
import type { MenuProps } from 'antd';
|
import type { MenuProps } from 'antd';
|
||||||
import { useLocation } from '@umijs/max';
|
|
||||||
import AvatarProps from './AvatarProps';
|
import AvatarProps from './AvatarProps';
|
||||||
import { useMyState } from '@/common';
|
import { useMyState } from '@/common';
|
||||||
|
|
||||||
@ -14,10 +13,9 @@ interface CustomHeaderProps {
|
|||||||
|
|
||||||
export const CustomHeader: React.FC<CustomHeaderProps> = ({ collapsed, toggle }) => {
|
export const CustomHeader: React.FC<CustomHeaderProps> = ({ collapsed, toggle }) => {
|
||||||
const { snap } = useMyState();
|
const { snap } = useMyState();
|
||||||
const { pathname } = useLocation();
|
|
||||||
|
|
||||||
// 在登录页面不显示header
|
// 在登录页面不显示header
|
||||||
if (pathname === '/login') {
|
if (typeof window !== 'undefined' && window.location.pathname === '/login') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user