support user

This commit is contained in:
maojindao55
2025-04-01 07:26:40 +08:00
parent 4a5a224056
commit 6929aa8a47
3 changed files with 62 additions and 0 deletions

25
src/store/userStore.ts Normal file
View File

@@ -0,0 +1,25 @@
import { create } from 'zustand'
interface UserInfo {
id: number;
phone: string;
nickname: string;
avatar_url: string | null;
status: number;
}
interface UserStore {
userInfo: UserInfo;
setUserInfo: (userInfo: UserInfo) => void;
}
export const useUserStore = create<UserStore>((set) => ({
userInfo: {
id: 0,
phone: '',
nickname: '',
avatar_url: null,
status: 0
},
setUserInfo: (userInfo: UserInfo) => set({ userInfo })
}));