/** * User 状态机:State 形状 + 初始值 */ import type { UserView } from "@/data/dto/user"; export interface UserState { currentUser: UserView | null; isLoading: boolean; avatarUrl: string | null; isVip: boolean; creditBalance: number; } export const initialState: UserState = { currentUser: null, isLoading: false, avatarUrl: null, isVip: false, creditBalance: 0, };