From 463e5eb41996889287c4e3c1855f71e63e918035 Mon Sep 17 00:00:00 2001 From: Theo <971366405@qq.com> Date: Sat, 28 Sep 2024 00:12:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E9=A6=96=E9=A1=B5ws=E8=8E=B7=E5=8F=96=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E4=BA=BA=E6=95=B0=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构首页ws获取在线人数的代码 --- src/store/modules/user.ts | 2 +- src/views/dashboard/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index c8aa2ce3..db62ab55 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -69,7 +69,7 @@ export const useUserStore = defineStore("user", () => { // remove token function resetToken() { return new Promise((resolve) => { - localStorage.setItem(TOKEN_KEY, ""); + removeToken(); resetRouter(); resolve(); }); diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index f7d1ce1f..8a940a97 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -188,7 +188,7 @@