import { invalidateCache } from 'alova'; import HTTP from '@/request/alova'; import { application } from '@/request/model'; import { getPinia, usePlatformStore } from '@/stores'; export * from './account.api'; export * from './questionnaire.api'; export * from './report.api'; export function getApplicationMethod() { return HTTP.Post(`/fdhb-tablet/warrantManage/getPageSets`, void 0, { cacheFor, shareRequest: true, transform: application, }); } export function toggleApplicationMethod() { const pinia = getPinia(); const warrant = usePlatformStore(pinia).serialNumber ?? ''; return HTTP.Post( `/fdhb-tablet/warrantManage/updateWarrant`, { warrant }, { cacheFor: null, async transform() { await invalidateCache(); const store = (pinia as any)._s as Map void }>; for (const [key, value] of store) if (key !== 'platform') value.$reset?.(); }, } ); } export const cacheFor = 24 * 60 * 60 * 1000;