mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-11 23:40:24 +00:00
16 lines
285 B
TypeScript
16 lines
285 B
TypeScript
import { useLocalStorage } from '@uidotdev/usehooks'
|
|
|
|
import key from '@/const/key'
|
|
|
|
const useAuth = () => {
|
|
const [token, setToken] = useLocalStorage<string>(key.token, '')
|
|
|
|
return {
|
|
token,
|
|
isAuth: !!token,
|
|
revokeAuth: () => setToken('')
|
|
}
|
|
}
|
|
|
|
export default useAuth
|