From 066fe015f95e137f2970b4602a1847377d66c889 Mon Sep 17 00:00:00 2001 From: mackt <1033530438@qq.com> Date: Thu, 18 Apr 2024 20:05:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(Header):=20=E6=B0=B4=E5=90=88=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header/Auth.tsx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/components/Header/Auth.tsx b/src/components/Header/Auth.tsx index e97d478..439cca7 100644 --- a/src/components/Header/Auth.tsx +++ b/src/components/Header/Auth.tsx @@ -1,6 +1,5 @@ 'use client'; -import { parseCookies } from 'nookies'; import { useShallow } from 'zustand/react/shallow'; import HeaderAvatar from './HeaderAvatar'; @@ -9,9 +8,9 @@ import { LoginModal } from '@/components'; import useUserStore from '@/store/user'; export default function Auth() { - const { token } = parseCookies(); - const { showLogin, setShowLogin } = useUserStore( + const { userInfo, showLogin, setShowLogin } = useUserStore( useShallow((state) => ({ + userInfo: state.userInfo, showLogin: state.showLogin, setShowLogin: state.setShowLogin, })), @@ -19,17 +18,15 @@ export default function Auth() { return (