From e0480a5ce48baa657ba1d26005405b045b663ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Fri, 30 Aug 2024 12:02:16 +0800 Subject: [PATCH] fix: modify --- src/utils/auth.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/auth.ts b/src/utils/auth.ts index 2d96ffb..ca29e11 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -17,7 +17,9 @@ export function removeToken() { } // 为什么这里使用 localStorage, 防止刷新后丢失 export function getTrxToken() { - return localStorage.getItem(trxTokenKey) + const value = localStorage.getItem(trxTokenKey) + if (value === 'undefined') return '' + return value } export function setTrxToken(token: string) {