Commit e2b8bf86 authored by huangjie's avatar huangjie

*

parent c38e6f47
......@@ -45,7 +45,6 @@
"element-resize-detector": "^1.2.4",
"element-ui": "2.15.12",
"file-saver": "2.0.5",
"flatted": "^3.2.7",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"jquery": "^3.7.0",
......
......@@ -99,6 +99,7 @@ export default {
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
localStorage.removeItem('views') //清空导航栏上的数据
location.href = '/index';
})
}).catch(() => {});
......@@ -110,9 +111,13 @@ export default {
setToken(res.data.token)
setTenantid(id)
store.commit('SET_TOKEN', res.data.token)
localStorage.removeItem('views') //清空导航栏上的数据
if(this.$route.path == '/index'){
location.reload();
}else{
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}
}
})
}
}
......
......@@ -21,7 +21,6 @@ import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex'
import variables from '@/assets/styles/variables.scss'
import elementResizeDetectorMaker from "element-resize-detector"
import { parse,stringify } from 'flatted';
export default {
name: 'Layout',
components: {
......
import { parse,stringify } from 'flatted';
const state = {
visitedViews: [],
cachedViews: [],
......@@ -22,28 +21,6 @@ const mutations = {
title: view.meta.title || 'no-name'
})
)
// console.log(state.visitedViews)
// try {
// stringify(view)
// }catch(e)
// {
//
// }
// console.log(
// localStorage.removeItem('views')
// let views =view
// let viewlist = localStorage.getItem("views")==null?[]:JSON.parse(localStorage.getItem("views"))
// let li = {}
// li.fullPath = view.fullPath
// li.hash = view.hash
// li.meta = view.meta
// li.name = view.name
// li.params = view.params
// li.path = view.path
// li.query = view.query
// viewlist.push(li)
// viewlist.push(parse(stringify(view)))
// localStorage.setItem("views",stringify(viewlist))
},
ADD_CACHED_VIEW: (state, view) => {
if (state.cachedViews.includes(view.name)) return
......@@ -55,8 +32,6 @@ const mutations = {
for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) {
state.visitedViews.splice(i, 1)
let visitedViews = JSON.parse(JSON.stringify(state.visitedViews))
localStorage.setItem("views",JSON.stringify(visitedViews))
break
}
}
......
......@@ -336,7 +336,7 @@
checkedKeys.forEach((v) => {
v = v.trim()
let nodes = this.$refs.menu.getNode(v)
if(nodes.isLeaf && nodes.isLeaf == true){
if(nodes&&nodes.isLeaf && nodes.isLeaf == true){
this.$refs.menu.setChecked(v,true,true);
}else{
this.$refs.menu.setChecked(v,true,false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment