Merge pull request #3853 from dataease/pr@dev@fix_new-tab

fix: 修复浏览器复制新的窗口可能出现仪表板列表无法显示的问题
This commit is contained in:
Junjun 2022-11-24 16:41:57 +08:00 committed by GitHub
commit 4f9f0fb12e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -926,7 +926,7 @@ export default {
if (userCache) { if (userCache) {
this.defaultData = JSON.parse(modelInfo) this.defaultData = JSON.parse(modelInfo)
if (showFirst && this.defaultData.length > 0) { if (showFirst && this.defaultData && this.defaultData.length > 0) {
this.activeDefaultNodeAndClickOnly(this.defaultData[0].id) this.activeDefaultNodeAndClickOnly(this.defaultData[0].id)
} }
} }
@ -935,7 +935,7 @@ export default {
localStorage.setItem('panel-default-tree', JSON.stringify(res.data)) localStorage.setItem('panel-default-tree', JSON.stringify(res.data))
if (!userCache) { if (!userCache) {
this.defaultData = res.data this.defaultData = res.data
if (showFirst && this.defaultData.length > 0) { if (showFirst && this.defaultData && this.defaultData.length > 0) {
this.activeDefaultNodeAndClickOnly(this.defaultData[0].id) this.activeDefaultNodeAndClickOnly(this.defaultData[0].id)
} }
} }