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 { ...@@ -61,7 +61,6 @@ class AvatarDropdown extends React.Component {
</Menu.Item> </Menu.Item>
</Menu> </Menu>
); );
let role = JSON.parse(localStorage.getItem('panda-oms-authority'))[1];
return currentUser ? ( return currentUser ? (
<HeaderDropdown overlay={menuHeaderDropdown}> <HeaderDropdown overlay={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}> <span className={`${styles.action} ${styles.account}`}>
...@@ -72,8 +71,9 @@ class AvatarDropdown extends React.Component { ...@@ -72,8 +71,9 @@ class AvatarDropdown extends React.Component {
alt="avatar" alt="avatar"
/> />
<span className={`${styles.name} anticon`}> <span className={`${styles.name} anticon`}>
{roleName[role]} {currentUser.name || loginName === 'omsa'
{/* {currentUser.name || loginName || '管理员'} */} ? '超级管理员'
: '管理员' || '管理员'}
</span> </span>
</span> </span>
</HeaderDropdown> </HeaderDropdown>
......
...@@ -80,8 +80,11 @@ const SiteManage = props => { ...@@ -80,8 +80,11 @@ const SiteManage = props => {
arr.push(res.find(item => item.id === 'Web4StationRoot')); arr.push(res.find(item => item.id === 'Web4StationRoot'));
} }
if (arr[0]) { if (arr[0]) {
const stations = arr[0].children; const stations = arr[0].children || [];
setTreeData(stations); setTreeData(stations);
if (stations.length < 1) {
return;
}
if (!currentStation.stationID) { if (!currentStation.stationID) {
setCurrentStation(stations[0]); setCurrentStation(stations[0]);
} else { } else {
...@@ -109,7 +112,7 @@ const SiteManage = props => { ...@@ -109,7 +112,7 @@ const SiteManage = props => {
}, [page.pageNum]); }, [page.pageNum]);
const getList = name => { const getList = name => {
let params = { let params = {
stationId: +currentStation.stationID, stationId: +currentStation.stationID || '',
PageIndex: +page.pageNum, PageIndex: +page.pageNum,
PageSize: +page.pageSize, 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