返回 AiToEarn
xiaohongshu.ts
根目录 / project / aitoearn-electron / src / store / xiaohongshu.ts
1 import { create } from 'zustand';
2
3 interface XiaohongshuState {
4 loginInfo: {
5 cookie?: string;
6 userInfo?: {
7 authorId: string;
8 nickname: string;
9 avatar: string;
10 fansCount: number;
11 };
12 localStorage?: string;
13 } | null;
14 setLoginInfo: (info: any) => void;
15 clearLoginInfo: () => void;
16 }
17
18 export const useXiaohongshuStore = create<XiaohongshuState>((set) => ({
19 loginInfo: null,
20 setLoginInfo: (info) => set({ loginInfo: info }),
21 clearLoginInfo: () => set({ loginInfo: null }),
22 }));
23
23 lines TYPESCRIPT