chore: initialize insar management system v2

This commit is contained in:
2026-04-14 13:16:01 +08:00
commit ecc72ec9cd
361 changed files with 2142522 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import { create } from 'zustand';
// 支持函数式更新的 setter 工厂
const s = (set, key) => (v) =>
set((state) => ({ [key]: typeof v === 'function' ? v(state[key]) : v }));
export const useAuthStore = create((set) => ({
currentUser: null,
authChecked: false,
licenseStatus: { ok: false, reason: '', expires_at: null },
licenseLoading: true,
licenseUploadStatus: { type: '', message: '' },
licenseFileName: '',
healthStatus: null,
healthLoading: false,
healthError: '',
setCurrentUser: s(set, 'currentUser'),
setAuthChecked: s(set, 'authChecked'),
setLicenseStatus: s(set, 'licenseStatus'),
setLicenseLoading: s(set, 'licenseLoading'),
setLicenseUploadStatus: s(set, 'licenseUploadStatus'),
setLicenseFileName: s(set, 'licenseFileName'),
setHealthStatus: s(set, 'healthStatus'),
setHealthLoading: s(set, 'healthLoading'),
setHealthError: s(set, 'healthError'),
}));