| | |
| | | MenuID: this.props.MenuID |
| | | } |
| | | Api.getCacheConfig(_param).then(result => { |
| | | if (result.status) { |
| | | if (result.LongParam) { |
| | | let config = '' |
| | | let view = 'default' |
| | | if (result.status && result.LongParam) { |
| | | let config = '' |
| | | |
| | | try { // 配置信息解析 |
| | | config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | | } |
| | | |
| | | if (!config || !config.enabled) { |
| | | this.setState({ |
| | | loading: false, |
| | | waiting: false, |
| | | view: 'default' |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false, |
| | | view: 'custom' |
| | | }) |
| | | } |
| | | } else { |
| | | this.setState({ |
| | | loading: false, |
| | | waiting: false, |
| | | view: 'default' |
| | | }) |
| | | try { // 配置信息解析 |
| | | config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | | } |
| | | } else { |
| | | |
| | | if (config && config.enabled) { |
| | | view = 'custom' |
| | | } |
| | | } |
| | | |
| | | if (view === 'default') { |
| | | this.setState({ |
| | | loading: false, |
| | | waiting: false, |
| | | view: 'default' |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false, |
| | | view: 'custom' |
| | | }) |
| | | } |
| | | |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |