更新字典获取方式
This commit is contained in:
15
src/app.tsx
Normal file
15
src/app.tsx
Normal 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 {};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user