mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-15 14:24:39 +00:00
perf: save to localStorage except cookie
This commit is contained in:
@@ -6,20 +6,23 @@ import store from '@/store'
|
||||
import { isSameView } from '@/utils/jms'
|
||||
import { toSentenceCase } from '@/utils/common'
|
||||
|
||||
// NProgress.configure({
|
||||
// showSpinner: false
|
||||
// }) // NProgress Configuration
|
||||
//
|
||||
function beforeRouteChange(to, from, next) {
|
||||
localStorage.setItem('activeTab', '')
|
||||
}
|
||||
|
||||
router.beforeEach(async(to, from, next) => {
|
||||
// start progress bar
|
||||
// NProgress.start()
|
||||
try {
|
||||
await store.dispatch('common/cleanDrawerActionMeta')
|
||||
await startup({ to, from, next })
|
||||
if (to.name !== from.name) {
|
||||
await beforeRouteChange(to, from, next)
|
||||
}
|
||||
next()
|
||||
} catch (e) {
|
||||
const msg = 'Start service error: ' + e
|
||||
// debug(e)
|
||||
console.log(msg)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -132,14 +132,14 @@ export default {
|
||||
handleTabClick(tab) {
|
||||
this.$emit('tab-click', tab)
|
||||
this.iActiveMenu = tab.name
|
||||
this.$cookie.set('activeTab', tab.name, 1)
|
||||
localStorage.setItem('activeTab', tab.name)
|
||||
},
|
||||
getPropActiveTab() {
|
||||
let activeTab = ''
|
||||
|
||||
const preActiveTabs = [
|
||||
this.$route.query['tab'],
|
||||
this.$cookie.get('activeTab'),
|
||||
localStorage.getItem('activeTab'),
|
||||
this.activeMenu
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user