feat: add login state

This commit is contained in:
tim
2025-07-05 13:58:24 +08:00
parent f58a22e068
commit 94a1b4a237
2 changed files with 20 additions and 1 deletions

View File

@@ -14,6 +14,12 @@ export function clearToken() {
localStorage.removeItem(TOKEN_KEY)
}
export function isLogin() {
const token = getToken()
console.log('token', token)
return token !== null && token !== ''
}
export async function checkToken() {
const token = getToken()
if (!token) return false