Commit 8b2a222a authored by Maofei94's avatar Maofei94

fix: 管理员昵称展示

parent ca1ddab2
Pipeline #22131 passed with stages
in 19 minutes 22 seconds
......@@ -61,7 +61,6 @@ class AvatarDropdown extends React.Component {
</Menu.Item>
</Menu>
);
let role = JSON.parse(localStorage.getItem('panda-oms-authority'))[1];
return currentUser ? (
<HeaderDropdown overlay={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}>
......@@ -72,8 +71,9 @@ class AvatarDropdown extends React.Component {
alt="avatar"
/>
<span className={`${styles.name} anticon`}>
{roleName[role]}
{/* {currentUser.name || loginName || '管理员'} */}
{currentUser.name || loginName === 'omsa'
? '超级管理员'
: '管理员' || '管理员'}
</span>
</span>
</HeaderDropdown>
......
......@@ -80,8 +80,11 @@ const SiteManage = props => {
arr.push(res.find(item => item.id === 'Web4StationRoot'));
}
if (arr[0]) {
const stations = arr[0].children;
const stations = arr[0].children || [];
setTreeData(stations);
if (stations.length < 1) {
return;
}
if (!currentStation.stationID) {
setCurrentStation(stations[0]);
} else {
......@@ -109,7 +112,7 @@ const SiteManage = props => {
}, [page.pageNum]);
const getList = name => {
let params = {
stationId: +currentStation.stationID,
stationId: +currentStation.stationID || '',
PageIndex: +page.pageNum,
PageSize: +page.pageSize,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment