From 64671bc1214869301fd7bd0eca777864576ab1af Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 16 八月 2023 17:40:10 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/home/index.jsx | 52 +++++++++++++++++++++++----------------------------- 1 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/tabviews/home/index.jsx b/src/tabviews/home/index.jsx index a6a8a60..d91ecef 100644 --- a/src/tabviews/home/index.jsx +++ b/src/tabviews/home/index.jsx @@ -56,42 +56,36 @@ 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 { // 閰嶇疆淇℃伅瑙f瀽 - 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 { // 閰嶇疆淇℃伅瑙f瀽 + 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, -- Gitblit v1.8.0