From 96404848955f84d57b88dd240ab3a57b7017103c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Mon, 13 Sep 2021 19:04:02 +0800 Subject: [PATCH] fix: fixed token clear error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复将token设置为undefined时可能失败的问题 --- src/store/modules/user.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index b0c43f8d..8461efdc 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -58,7 +58,7 @@ export const useUserStore = defineStore({ }, actions: { setToken(info: string | undefined) { - this.token = info; + this.token = info ? info : ''; // for null or undefined value setAuthCache(TOKEN_KEY, info); }, setRoleList(roleList: RoleEnum[]) { -- GitLab