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) {