11.15 工作台跳转会议室预约角色校验

This commit is contained in:
jl-zhoujl2
2022-11-15 15:43:50 +08:00
parent 9b5b689e45
commit c852fd29e0
3 changed files with 53 additions and 4 deletions

View File

@ -0,0 +1,41 @@
import React, { useEffect } from 'react';
import { Spin } from 'antd';
import { getSessionUserData } from '@/utils/session';
import { history } from 'umi';
const Loading: React.FC<{}> = () => {
/**
* 预约人员-会议预约跳转中转页
*/
useEffect(() => {
//获取角色列表
const authorityList: any[] = getSessionUserData()?.authorityList;
for (let i = 0, length = authorityList.length; i < length; i++) {
const item = authorityList[i];
if (item.roleCode == "ebtp-appointment") {
sessionStorage.setItem('roleAuthority', JSON.stringify([item.roleCode]));//放置权限字
sessionStorage.setItem('roleData', JSON.stringify(item));//放置roleData
break;
}
}
history.replace({ pathname: "/ElecEvaluation/AppointmentManage", state: { redirect: true } });
}, []);
return (
<div
style={{
textAlign: 'center',
height: '100%',
background: 'rgba(0,0,0,.05)',
position: 'relative',
}}
>
<div style={{ position: 'absolute', left: '50%', top: '48%' }}>
<Spin tip="Loading..." />
</div>
</div>
);
};
export default Loading;