king
2022-04-15 21d92eff0e23974d76e3e5a79ba50e3fc1c0b879
src/components/header/index.jsx
@@ -38,7 +38,8 @@
    visible: false, // 修改密码模态框
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    confirmLoading: false,
    userName: sessionStorage.getItem('User_Name'),
    userName: '',
    fullName: '',
    logourl: window.GLOB.mainlogo,
    appVersion: window.GLOB.appVersion,
    loginVisible: false,
@@ -609,6 +610,15 @@
  UNSAFE_componentWillMount () {
    // 组件加载时,获取菜单数据
    this.getRolesMenu()
    let fullName = sessionStorage.getItem('Full_Name') || ''
    let userName = sessionStorage.getItem('User_Name') || ''
    if (fullName.toLowerCase() === userName.toLowerCase()) {
      userName = ''
    }
    this.setState({fullName, userName})
  }
  componentDidMount () {
@@ -838,7 +848,7 @@
          <div>
            <img src={this.state.avatar || avatar} alt=""/>
            <span>
              <span className="username">{this.state.userName}</span> <DownOutlined />
              <span className="username"><span>{this.state.fullName}</span>{this.state.userName ? <span>{this.state.userName}</span> : null}</span> <DownOutlined />
            </span>
          </div>
        </Dropdown>