| | |
| | | type: 'CustomPage' |
| | | } |
| | | |
| | | reloading = false |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { params, path } = this.props.match |
| | | const { menuId, loginUid, bid } = params |
| | |
| | | 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, |
| | |
| | | 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) => { |
| | | const { MenuId, BID } = this.state |
| | | |