Commit e2b8bf86 authored by huangjie's avatar huangjie

*

parent c38e6f47
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
"element-resize-detector": "^1.2.4", "element-resize-detector": "^1.2.4",
"element-ui": "2.15.12", "element-ui": "2.15.12",
"file-saver": "2.0.5", "file-saver": "2.0.5",
"flatted": "^3.2.7",
"fuse.js": "6.4.3", "fuse.js": "6.4.3",
"highlight.js": "9.18.5", "highlight.js": "9.18.5",
"jquery": "^3.7.0", "jquery": "^3.7.0",
......
...@@ -99,6 +99,7 @@ export default { ...@@ -99,6 +99,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('LogOut').then(() => {
localStorage.removeItem('views') //清空导航栏上的数据
location.href = '/index'; location.href = '/index';
}) })
}).catch(() => {}); }).catch(() => {});
...@@ -110,8 +111,12 @@ export default { ...@@ -110,8 +111,12 @@ export default {
setToken(res.data.token) setToken(res.data.token)
setTenantid(id) setTenantid(id)
store.commit('SET_TOKEN', res.data.token) store.commit('SET_TOKEN', res.data.token)
location.reload(); localStorage.removeItem('views') //清空导航栏上的数据
this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); if(this.$route.path == '/index'){
location.reload();
}else{
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}
} }
}) })
} }
......
...@@ -21,7 +21,6 @@ import ResizeMixin from './mixin/ResizeHandler' ...@@ -21,7 +21,6 @@ import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import variables from '@/assets/styles/variables.scss' import variables from '@/assets/styles/variables.scss'
import elementResizeDetectorMaker from "element-resize-detector" import elementResizeDetectorMaker from "element-resize-detector"
import { parse,stringify } from 'flatted';
export default { export default {
name: 'Layout', name: 'Layout',
components: { components: {
......
import { parse,stringify } from 'flatted';
const state = { const state = {
visitedViews: [], visitedViews: [],
cachedViews: [], cachedViews: [],
...@@ -22,28 +21,6 @@ const mutations = { ...@@ -22,28 +21,6 @@ const mutations = {
title: view.meta.title || 'no-name' 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) => { ADD_CACHED_VIEW: (state, view) => {
if (state.cachedViews.includes(view.name)) return if (state.cachedViews.includes(view.name)) return
...@@ -55,8 +32,6 @@ const mutations = { ...@@ -55,8 +32,6 @@ const mutations = {
for (const [i, v] of state.visitedViews.entries()) { for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) { if (v.path === view.path) {
state.visitedViews.splice(i, 1) state.visitedViews.splice(i, 1)
let visitedViews = JSON.parse(JSON.stringify(state.visitedViews))
localStorage.setItem("views",JSON.stringify(visitedViews))
break break
} }
} }
......
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
checkedKeys.forEach((v) => { checkedKeys.forEach((v) => {
v = v.trim() v = v.trim()
let nodes = this.$refs.menu.getNode(v) 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); this.$refs.menu.setChecked(v,true,true);
}else{ }else{
this.$refs.menu.setChecked(v,true,false); 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