mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-30 18:09:40 +05:00
Merge remote-tracking branch 'origin/feat_player'
This commit is contained in:
parent
bb437fe7ca
commit
25e31a7799
62 changed files with 1508 additions and 701 deletions
|
@ -1,13 +1,22 @@
|
|||
"use client";
|
||||
import { create } from "zustand";
|
||||
import { getJWT, setJWT, removeJWT, fetchDataViaGet } from "@/app/api/utils";
|
||||
import { getJWT, removeJWT, fetchDataViaGet } from "#/api/utils";
|
||||
|
||||
export const useUserStore = create((set, get) => ({
|
||||
interface userState {
|
||||
isAuth: boolean
|
||||
user: Object | null
|
||||
token: string | null
|
||||
login: (user: Object, token: string) => void
|
||||
logout: () => void
|
||||
checkAuth: () => void
|
||||
}
|
||||
|
||||
export const useUserStore = create<userState>((set, get) => ({
|
||||
isAuth: false,
|
||||
user: null,
|
||||
token: null,
|
||||
|
||||
login: (user, token) => {
|
||||
login: (user: Object, token: string) => {
|
||||
set({ isAuth: true, user: user, token: token });
|
||||
},
|
||||
logout: () => {
|
Loading…
Add table
Add a link
Reference in a new issue