// src/app.ts
import { message } from 'antd';
import { refreshDictCache } from './servers/api';

export async function getInitialState() {
  try {
    const res = await refreshDictCache();
    if (res.code == 200) {
      sessionStorage.setItem('dict', JSON.stringify(res.data));
    }
  } catch (e) {
    message.error('初始化失败');
    return {};
  }
}
