king
2024-10-11 8e003c1a94d26cc4d477e7aa03593ccb4d7e6c61
src/components/header/index.jsx
@@ -56,7 +56,9 @@
  componentDidMount () {
    // 获取系统的版本信息,延时查询
    setTimeout(() => {
      if (!window.GLOB.$error) {
      Api.getAppVersion()
      }
    }, 1000)
    // sessionStorage 跨页面共享
@@ -109,6 +111,7 @@
      setTimeout(() => {
        sessionStorage.clear()
        this.props.history.replace('/login')
        window.location.reload()
      }, 2000)
    })
  }
@@ -116,7 +119,7 @@
  logout = () => {
    const { dict } = this.state
    // 退出登录
    let _this = this
    let that = this
    confirm({
      title: dict['logout_query'] || '您确定要退出吗?',
      content: '',
@@ -124,7 +127,7 @@
      cancelText: dict['cancel'] || '取消',
      onOk() {
        sessionStorage.clear()
        _this.props.history.replace('/login')
        that.props.history.replace('/login')
        window.location.reload()
      },
      onCancel() {}