refactor(monorepo): decouple api and webui into workspaces packages

This commit is contained in:
yiling
2026-06-01 23:35:00 +08:00
parent e3f4fa219e
commit 1f341c15d0
288 changed files with 18024 additions and 21178 deletions
+22
View File
@@ -0,0 +1,22 @@
import { create } from 'zustand'
import { persist, createJSONStorage } from 'zustand/middleware'
interface AuthState {
user: unknown | null
setUser: (user: unknown) => void
clearAuth: () => void
}
export const useAuthStore = create<AuthState>()(
persist(
(set) => ({
user: null,
setUser: (user) => set({ user }),
clearAuth: () => set({ user: null }),
}),
{
name: 'auth-storage',
storage: createJSONStorage(() => localStorage),
},
),
)