更新字典获取方式

This commit is contained in:
linxd
2025-07-29 13:52:51 +08:00
parent 747cceeb18
commit 49105505fa
4 changed files with 37 additions and 3 deletions

15
src/app.tsx Normal file
View File

@ -0,0 +1,15 @@
// 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 {};
}
}