From 9008ae8511295635d526f103ec13cb0a79ca786f Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Thu, 4 Jul 2024 09:17:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=99=BB=E5=BD=95=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E5=90=8E=E6=B2=A1=E6=9C=89=E7=94=A8=E6=88=B7=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Auth.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stores/Auth.js b/src/stores/Auth.js index 0b0a211..8b17a0b 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -126,11 +126,16 @@ const useAuthStore = create((set, get) => ({ }, logout: () => { - const { tokenInterval } = get() + const { tokenInterval, currentUser } = get() const { clearStorage } = usingStorage() clearStorage() clearInterval(tokenInterval) - set(initialState) + set(() => ({ + ...initialState, + currentUser: { + username: currentUser.username + } + })) }, startTokenInterval: () => {