import defaultSettings from '../config/defaultSettings'; import errorConfig from './requestErrorConfig'; import { RequestConfig } from './utils/umiExport'; export async function getInitialState(): Promise<{ settings: any; currentUser: any; func: []; dictionary: any; }> { localStorage.setItem("defaultSettings", JSON.stringify(defaultSettings)) const initialData = { settings: defaultSettings, currentUser: JSON.parse(localStorage.getItem('currentUser') || '{}'), func: JSON.parse(localStorage.getItem('functions') || '[]'), dictionary: JSON.parse(localStorage.getItem('dictionary') || '{}'), }; return initialData; } export const request: RequestConfig = { ...errorConfig };