字典存入缓存

This commit is contained in:
孙景学
2025-07-23 16:49:35 +08:00
parent 3ce3ab0036
commit 1bd423b66a
4 changed files with 19 additions and 5 deletions

View File

@ -3,7 +3,7 @@ import { Form, Input, Button, Checkbox, Tabs, message } from 'antd';
import { UserOutlined, LockOutlined, EyeInvisibleOutlined, EyeTwoTone } from '@ant-design/icons';
import { history, useIntl } from 'umi';
import './login.less';
import { getCaptcha, supplierLogin, expertLogin, accountLogin, getUserinfo } from '@/servers/api/login';
import { getCaptcha, supplierLogin, expertLogin, accountLogin, getUserinfo, refreshDictCache } from '@/servers/api/login';
import { encryptWithRsa } from '@/utils/encryptWithRsa'
@ -80,6 +80,12 @@ const LoginPage: React.FC = () => {
}
sessionStorage.setItem('currentUser', JSON.stringify(loginRes.data));
refreshDictCache().then((res) => {
if(res.code == 200) {
sessionStorage.setItem('dict', JSON.stringify(res.data))
}
})
getUserinfo().then(async (res) => {
// if(res.code == 200) {
const roleIdList = res.authorityList.map((item: any) => {