fix(仪表板): 修复Cas重新登录后看不到数据列表问题

This commit is contained in:
wangjiahao 2024-05-30 11:24:22 +08:00
parent 2bb9cdabc4
commit 6b9812bd6a

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)
}