更新代码
This commit is contained in:
@ -3,7 +3,7 @@ import { Form, Input, Button, Checkbox, Tabs, message } from 'antd';
|
||||
import { UserOutlined, LockOutlined, EyeInvisibleOutlined, EyeTwoTone, HomeOutlined } from '@ant-design/icons';
|
||||
import { history, useIntl } from 'umi';
|
||||
import './login.less';
|
||||
import { getCaptcha, supplierLogin, expertLogin, accountLogin } from '@/servers/api/login';
|
||||
import { getCaptcha, supplierLogin, expertLogin, accountLogin, getUserinfo, findMenuList } from '@/servers/api/login';
|
||||
|
||||
import { encryptWithRsa } from '@/utils/encryptWithRsa'
|
||||
import Password from 'antd/lib/input/Password';
|
||||
@ -51,6 +51,20 @@ const LoginPage: React.FC = () => {
|
||||
// sessionStorage.setItem('userId', loginRes.data.supplierUser.userId);
|
||||
}
|
||||
sessionStorage.setItem('currentUser', JSON.stringify(loginRes.data));
|
||||
|
||||
getUserinfo().then( async (res) => {
|
||||
// if(res.code == 200) {
|
||||
const roleIdList = res.authorityList.map((item:any) => {
|
||||
return item.roleId
|
||||
})
|
||||
console.log(roleIdList,'roleIdList');
|
||||
|
||||
const menuList = await findMenuList({ roleIdList });
|
||||
sessionStorage.setItem('menuList', JSON.stringify(menuList.data));
|
||||
// }
|
||||
})
|
||||
|
||||
|
||||
message.success('登录成功');
|
||||
history.push('/index');
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user