king
2024-05-21 f0bf8c399c354c22227f8f1a76ed806098db59c0
src/views/mkiframe/index.jsx
@@ -19,6 +19,8 @@
    type: 'CustomPage'
  }
  reloading = false
  UNSAFE_componentWillMount() {
    const { params, path } = this.props.match
    const { menuId, loginUid, bid } = params
@@ -112,6 +114,10 @@
    MKEmitter.addListener('modifyTabs', this.modifyTabs)
    MKEmitter.addListener('closeTabView', this.closeTabView)
    if (window.GLOB.forcedUpdate) {
      MKEmitter.addListener('reloadTabs', this.reloadTabs)
    }
    if (window.GLOB.sysType !== 'cloud') {
      Object.defineProperty(window, 'debugger', {
        configurable: true,
@@ -152,7 +158,24 @@
      return
    }
    MKEmitter.removeListener('modifyTabs', this.modifyTabs)
    MKEmitter.removeListener('reloadTabs', this.reloadTabs)
    MKEmitter.removeListener('closeTabView', this.closeTabView)
  }
  reloadTabs = () => {
    if (this.reloading) return
    this.reloading = true
    Api.getAppVersion(true).then(() => {
      window.location.reload()
    }, (message) => {
      notification.error({
        top: 92,
        message: message || '系统配置更新失败!',
        duration: 10
      })
    })
  }
  modifyTabs = (tab) => {
@@ -183,7 +206,10 @@
    let historys = sessionStorage.getItem('page_historys')
    historys = historys ? JSON.parse(historys) : []
    if (historys.length === 0) return
    if (historys.length === 0) {
      window.close()
      return
    }
    let tab = historys.shift()