01262103
This commit is contained in:
parent
713bd5f74b
commit
94cacc41df
|
@ -7,8 +7,10 @@ import { UserOutlined } from "@ant-design/icons";
|
||||||
import { UserMenu } from "../element/usermenu/usermenu";
|
import { UserMenu } from "../element/usermenu/usermenu";
|
||||||
import logo from "@web/src/assets/logo.png"
|
import logo from "@web/src/assets/logo.png"
|
||||||
import { env } from "@web/src/env";
|
import { env } from "@web/src/env";
|
||||||
|
import { Button } from "antd";
|
||||||
export const Header = memo(function Header() {
|
export const Header = memo(function Header() {
|
||||||
const { isAuthenticated } = useAuth();
|
const { isAuthenticated } = useAuth();
|
||||||
|
const navigate = useNavigate()
|
||||||
return (
|
return (
|
||||||
<header className="sticky top-0 z-50 bg-gradient-to-br from-primary-500 to-primary-800 text-white shadow-lg">
|
<header className="sticky top-0 z-50 bg-gradient-to-br from-primary-500 to-primary-800 text-white shadow-lg">
|
||||||
<div className="mx-auto px-4">
|
<div className="mx-auto px-4">
|
||||||
|
@ -28,10 +30,12 @@ export const Header = memo(function Header() {
|
||||||
{/* 右侧登录部分 */}
|
{/* 右侧登录部分 */}
|
||||||
<div className="flex items-center flex-shrink-0"> {/* 防止压缩 */}
|
<div className="flex items-center flex-shrink-0"> {/* 防止压缩 */}
|
||||||
{!isAuthenticated ? (
|
{!isAuthenticated ? (
|
||||||
<Link to="/auth" className="...">
|
<Button size="large" onClick={() => {
|
||||||
<UserOutlined className="..." />
|
navigate("/auth")
|
||||||
<span>登录</span>
|
}} type="primary" icon={<UserOutlined></UserOutlined>}>
|
||||||
</Link>
|
|
||||||
|
登录
|
||||||
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<UserMenu />
|
<UserMenu />
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in New Issue