We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bad4456 commit 435b2ffCopy full SHA for 435b2ff
src/layouts/tabs/TabsView.vue
@@ -228,16 +228,17 @@ export default {
228
* 加载缓存的 tabs
229
*/
230
loadCachedTabs() {
231
- const cachedTabs = sessionStorage.getItem(process.env.VUE_APP_TBAS_KEY)
232
- if (cachedTabs) {
+ const cachedTabsStr = sessionStorage.getItem(process.env.VUE_APP_TBAS_KEY)
+ if (cachedTabsStr) {
233
try {
234
- const tabs = JSON.parse(cachedTabs)
235
- if (tabs.length > 0) {
236
- this.pageList = tabs
+ const cachedTabs = JSON.parse(cachedTabsStr)
+ if (cachedTabs.length > 0) {
+ this.pageList = cachedTabs
237
}
238
- sessionStorage.removeItem(process.env.VUE_APP_TBAS_KEY)
239
} catch (e) {
240
console.warn('failed to load cached tabs, got exception:', e)
+ } finally {
241
+ sessionStorage.removeItem(process.env.VUE_APP_TBAS_KEY)
242
243
244
},
0 commit comments