mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-28 09:00:48 +08:00
feat: add login state
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user