From dc258e4600bea2fba1e25054d163a2f4b1326a85 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 08 八月 2023 10:23:38 +0800 Subject: [PATCH] 2023-08-08 --- src/tabviews/custom/components/card/table-card/index.jsx | 10 +- src/tabviews/custom/components/card/prop-card/index.jsx | 14 +- src/tabviews/custom/components/chart/antv-scatter/index.jsx | 14 +- src/api/cacheutils.js | 12 -- src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 10 +- src/tabviews/custom/components/code/sand-box/index.jsx | 10 +- src/tabviews/custom/components/chart/antv-dashboard/index.jsx | 10 +- src/tabviews/custom/components/share/tabtransfer/index.jsx | 2 src/tabviews/custom/components/tree/antd-tree/index.jsx | 10 +- src/tabviews/custom/components/card/double-data-card/index.jsx | 10 +- src/tabviews/custom/components/chart/antv-G6/index.jsx | 10 +- src/tabviews/custom/components/table/normal-table/index.jsx | 10 +- src/tabviews/custom/components/chart/antv-pie/index.jsx | 10 +- src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 10 +- src/tabviews/custom/components/carousel/data-card/index.jsx | 10 +- src/tabviews/custom/components/carousel/prop-card/index.jsx | 10 +- src/api/index.js | 13 +-- src/tabviews/custom/components/calendar/index.jsx | 4 src/tabviews/custom/index.jsx | 2 src/tabviews/custom/components/card/balcony/index.jsx | 10 +- src/tabviews/custom/components/chart/custom-chart/index.jsx | 14 +- src/tabviews/custom/components/card/data-card/index.jsx | 12 +- 22 files changed, 102 insertions(+), 115 deletions(-) diff --git a/src/api/cacheutils.js b/src/api/cacheutils.js index bd14fa5..3184290 100644 --- a/src/api/cacheutils.js +++ b/src/api/cacheutils.js @@ -204,7 +204,7 @@ /** * @description 鑾峰彇IndexedDB涓殑閰嶇疆淇℃伅 */ - static getIndexDBCacheConfig (MenuID, limit) { + static getIndexDBCacheConfig (MenuID) { if (!window.GLOB.IndexDB) return Promise.resolve() return new Promise((resolve, reject) => { @@ -215,15 +215,7 @@ } request.onsuccess = () => { - if (limit && request.result) { - if (request.result.CreateDate > limit) { - resolve(request.result) - } else { - resolve() - } - } else { - resolve(request.result) - } + resolve(request.result) } }) } diff --git a/src/api/index.js b/src/api/index.js index b8c6aba..cd5b4fb 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -341,20 +341,15 @@ return new Promise((resolve, reject) => { if (window.GLOB.IndexDB) { let limit = minutes ? moment().subtract(minutes, 'minutes').format('YYYY-MM-DD HH:mm:ss') : '' - CacheUtils.getIndexDBCacheConfig(menuid, limit).then(res => { + CacheUtils.getIndexDBCacheConfig(menuid).then(res => { if (res && res.LongParam) { - let _data = JSON.parse(res.LongParam) - if (_data.length === 0) { - resolve() - } else { - resolve(_data) - } + resolve({data: JSON.parse(res.LongParam), valid: !limit || res.CreateDate > limit}) } else { - resolve() + resolve({data: null, valid: false}) } }) } else { - resolve() + resolve({data: null, valid: false}) } }) } diff --git a/src/tabviews/custom/components/calendar/index.jsx b/src/tabviews/custom/components/calendar/index.jsx index 52c638a..43b7021 100644 --- a/src/tabviews/custom/components/calendar/index.jsx +++ b/src/tabviews/custom/components/calendar/index.jsx @@ -91,10 +91,10 @@ if (config.$cache && !this.loaded) { Api.getLCacheConfig(config.uuid).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return let data = [] - res.forEach((item, index) => { + res.data.forEach((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index ff3bec1..fa7d47a 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -178,15 +178,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res[0] || {$$empty: true} + let _data = res.data[0] || {$$empty: true} _data.$$uuid = _data[config.setting.primaryKey] || '' this.setState({data: _data}) @@ -195,9 +195,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res[0] || {$$empty: true} + let _data = res.data[0] || {$$empty: true} _data.$$uuid = _data[config.setting.primaryKey] || '' this.setState({data: _data}) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 2604d6c..f629d61 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -261,15 +261,15 @@ if (config.$time && !config.setting.laypage) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - - if (!res || this.loaded) return - let _data = res.map((item, index) => { + if (!res.data || this.loaded) return + + let _data = res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$Index = index + 1 + '' @@ -289,9 +289,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res.map((item, index) => { + let _data = res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$Index = index + 1 + '' diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index ede9980..4ae9acd 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -286,21 +286,21 @@ if (config.$time && !config.setting.laypage) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res) { + if (!res.valid) { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res) return + if (!res.data) return - this.setState({data: getData(res)}) + this.setState({data: getData(res.data)}) }) } else { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: getData(res)}) + this.setState({data: getData(res.data)}) }) setTimeout(() => { diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index e22cc5b..dbb8131 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -180,15 +180,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - - if (!res || this.loaded) return + + if (!res.data || this.loaded) return - let _data = res[0] || {$$empty: true} + let _data = res.data[0] || {$$empty: true} _data.$$uuid = _data[config.setting.primaryKey] || '' this.setState({data: _data}) @@ -210,9 +210,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res[0] || {$$empty: true} + let _data = res.data[0] || {$$empty: true} _data.$$uuid = _data[config.setting.primaryKey] || '' this.setState({data: _data}) @@ -278,7 +278,7 @@ if (config.$cache && config.$time && config.wrap.autoExec) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res) { + if (!res.valid) { this.autoExec() } else { Api.writeCacheConfig(config.uuid, []) diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index 8f693fa..694ea66 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -161,15 +161,15 @@ if (config.$time && !config.setting.laypage) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res.map((item, index) => { + let _data = res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$Index = index + 1 + '' @@ -182,9 +182,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res.map((item, index) => { + let _data = res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$Index = index + 1 + '' diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index f83040f..bd06661 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -148,15 +148,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res.map((item, index) => { + let _data = res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$Index = index + 1 + '' @@ -172,9 +172,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res.map((item, index) => { + let _data = res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$Index = index + 1 + '' diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index 0088328..bf810fa 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -147,15 +147,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res[0] || {$$empty: true} + let _data = res.data[0] || {$$empty: true} _data.$$uuid = _data[config.setting.primaryKey] || '' this.setState({data: _data}) @@ -166,9 +166,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - let _data = res[0] || {$$empty: true} + let _data = res.data[0] || {$$empty: true} _data.$$uuid = _data[config.setting.primaryKey] || '' this.setState({data: _data}) diff --git a/src/tabviews/custom/components/chart/antv-G6/index.jsx b/src/tabviews/custom/components/chart/antv-G6/index.jsx index 53d4d4f..d009353 100644 --- a/src/tabviews/custom/components/chart/antv-G6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-G6/index.jsx @@ -1032,15 +1032,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() }) } else { @@ -1049,9 +1049,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() }) } diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index 429eeca..5bdf293 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -405,15 +405,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() }) } else { @@ -422,9 +422,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() }) } diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx index ead534b..d60f344 100644 --- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx +++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx @@ -175,15 +175,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data if (config.subtype !== 'ratioboard') { if (Array.isArray(this.data)) { @@ -200,9 +200,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data if (config.subtype !== 'ratioboard') { if (Array.isArray(this.data)) { diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 430d840..3ccda37 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -147,15 +147,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() }) } else { @@ -164,9 +164,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() }) } diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx index 200143e..3fb8d8b 100644 --- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx +++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx @@ -143,18 +143,18 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() - this.setState({empty: res.length === 0}) + this.setState({empty: res.data.length === 0}) }) } else { this.handleData() @@ -162,12 +162,12 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() - this.setState({empty: res.length === 0}) + this.setState({empty: res.data.length === 0}) }) } diff --git a/src/tabviews/custom/components/chart/custom-chart/index.jsx b/src/tabviews/custom/components/chart/custom-chart/index.jsx index 25c9741..e98f37f 100644 --- a/src/tabviews/custom/components/chart/custom-chart/index.jsx +++ b/src/tabviews/custom/components/chart/custom-chart/index.jsx @@ -132,18 +132,18 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() - this.setState({empty: res.length === 0}) + this.setState({empty: res.data.length === 0}) }) } else { this.handleData() @@ -151,12 +151,12 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.data = res + this.data = res.data this.handleData() - this.setState({empty: res.length === 0}) + this.setState({empty: res.data.length === 0}) }) } diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx index 6afc90e..560976e 100644 --- a/src/tabviews/custom/components/code/sand-box/index.jsx +++ b/src/tabviews/custom/components/code/sand-box/index.jsx @@ -114,15 +114,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res}, () => { + this.setState({data: res.data}, () => { this.renderView() }) }) @@ -132,9 +132,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res}, () => { + this.setState({data: res.data}, () => { this.renderView() }) }) diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index 9157f43..acda596 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -129,7 +129,7 @@ if (config.$cache && config.$time) { Api.getLCacheConfig(params[0].uuid, config.$time).then(res => { - if (!res) { + if (!res.valid) { this.getMainData(param, params, config.uuid) } }) diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index 5b94345..ae27a14 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -215,15 +215,15 @@ if (config.$time && !setting.laypage) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadmaindata() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res.map((item, index) => { + this.setState({data: res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$key = '' + item.key + item.$$uuid @@ -250,9 +250,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res.map((item, index) => { + this.setState({data: res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$key = '' + item.key + item.$$uuid diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index df3dd7f..ccff669 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -156,15 +156,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res.map((item, index) => { + this.setState({data: res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$Index = index + 1 + '' @@ -176,9 +176,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res.map((item, index) => { + this.setState({data: res.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$Index = index + 1 + '' diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index 3046ea7..a4fd24f 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -136,15 +136,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData() }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res}, () => { + this.setState({data: res.data}, () => { this.handleData() }) }) @@ -154,9 +154,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res}, () => { + this.setState({data: res.data}, () => { this.handleData() }) }) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 99dabc0..4d233b0 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -1131,7 +1131,7 @@ if (config.$cache && config.$time) { Api.getLCacheConfig(params[0].uuid, config.$time).then(res => { - if (!res) { + if (!res.valid) { this.getMainData(param, params, config.MenuID) } else { this.setState({ -- Gitblit v1.8.0