Merge pull request #9968 from dataease/pr@dev@fix_cas-panel

fix(仪表板): 修复Cas重新登录后看不到数据列表问题
This commit is contained in:
王嘉豪 2024-05-30 11:25:37 +08:00 committed by GitHub
commit 9c64c45683
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -989,9 +989,17 @@ export default {
},
tree(cache = false) {
const modelInfo = localStorage.getItem('panel-main-tree')
const userCache = modelInfo && cache
let preParse
if (modelInfo) {
try {
preParse = JSON.parse(modelInfo)
} catch (e) {
console.warn('panel-main-tree cache error')
}
}
const userCache = preParse && cache
if (userCache) {
this.originResourceTree = JSON.parse(modelInfo)
this.originResourceTree = preParse
this.sortTypeChange(this.localSortParams)
}
groupTree(this.groupForm, !userCache).then((res) => {
@ -1017,10 +1025,18 @@ export default {
panelType: 'system'
}
const modelInfo = localStorage.getItem('panel-default-tree')
const userCache = modelInfo && cache
let preParse
if (modelInfo) {
try {
preParse = JSON.parse(modelInfo)
} catch (e) {
console.warn('panel-default-tree cache error')
}
}
const userCache = preParse && cache
if (userCache) {
this.defaultData = JSON.parse(modelInfo)
this.defaultData = preParse
if (showFirst && this.defaultData && this.defaultData.length > 0) {
this.activeDefaultNodeAndClickOnly(this.defaultData[0].id)
}