【修改】修改导航不出现
This commit is contained in:
@@ -55,15 +55,22 @@ export default {
|
||||
popoverValue: false
|
||||
}
|
||||
},
|
||||
props:{
|
||||
menuAllDate:{
|
||||
type:Array
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
menuData: 'menuData'
|
||||
}),
|
||||
isSystemManager () {
|
||||
return this.menuData.some(menu => menu.id === 'AVL9YSB7ZF')
|
||||
console.log(this.menuData,"this.menuData")
|
||||
return this.menuAllDate.some(menu => menu.id === 'AVL9YSB7ZF')
|
||||
},
|
||||
isSystemManagerBelong () {
|
||||
return this.menuData.some(menu => menu.id === 'AVL9YSB7ZF' && menu.belong == 1)
|
||||
console.log(this.menuData,"isSystemManager")
|
||||
return this.menuAllDate.some(menu => menu.id === 'AVL9YSB7ZF' && menu.belong == 1)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -77,9 +84,6 @@ export default {
|
||||
this.$api.login.logout().then(_ => {
|
||||
this.$message.success('退出成功')
|
||||
this.$store.commit('saveUserInfo', null)
|
||||
this.$store.commit('savePathUrl', null)
|
||||
this.$store.commit('saveMenuName', null)
|
||||
this.$store.commit('saveMenuData', null)
|
||||
this.$store.commit('setHandleProcess', null)
|
||||
// var sevice = "http://"+window.location.host+"/";
|
||||
// var serviceUrl = encodeURIComponent(sevice);
|
||||
|
||||
@@ -89,8 +89,6 @@ instance.interceptors.response.use(function (response) {
|
||||
store.commit('saveUserInfo', null)
|
||||
store.commit('saveUserInfo', null)
|
||||
store.commit('savePathUrl', null)
|
||||
store.commit('saveMenuName', null)
|
||||
store.commit('saveMenuData', null)
|
||||
store.commit('setHandleProcess', null)
|
||||
router.push('/login')
|
||||
Message.error('登录超时过期')
|
||||
@@ -106,8 +104,6 @@ instance.interceptors.response.use(function (response) {
|
||||
store.commit('saveUserInfo', null)
|
||||
store.commit('saveUserInfo', null)
|
||||
store.commit('savePathUrl', null)
|
||||
store.commit('saveMenuName', null)
|
||||
store.commit('saveMenuData', null)
|
||||
store.commit('setHandleProcess', null)
|
||||
router.push('/login')
|
||||
Message.error('登录超时过期')
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<Header></Header>
|
||||
|
||||
<Header :menuAllDate="menuAllDate"></Header>
|
||||
</el-header>
|
||||
<el-container class="main-content">
|
||||
<el-aside width="200px">
|
||||
@@ -31,7 +30,8 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
menuData: []
|
||||
menuData: [],
|
||||
menuAllDate: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -112,8 +112,8 @@ export default {
|
||||
treeData.forEach(item => {
|
||||
obj[item.id] = item
|
||||
})
|
||||
this.$store.commit('saveMenuData', Object.values(obj))
|
||||
|
||||
this.$store.commit('saveMenuData', Object.values(obj))
|
||||
this.menuAllDate = Object.values(obj)
|
||||
this.getMenu()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user