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