【修改】修改bug

This commit is contained in:
zhoulingpo
2023-05-16 15:13:47 +08:00
parent aeaad5b86d
commit 2393f8e41e
2 changed files with 41 additions and 19 deletions
@@ -212,5 +212,7 @@ export default {
overflow: hidden;
height: 23px;
text-overflow: ellipsis;
word-break: keep-all;
line-height: 23px;
}
</style>
+39 -19
View File
@@ -86,7 +86,7 @@ export default {
data = []
}
data = data.sort((a, b) => a.sort - b.sort)
const menu = data.filter(item => item.belong)
const menu = data.filter(item => item.belong && !item.isButton)
let menuData = []
const menuFun = (menu) => {
menuData = [...menuData, ...menu]
@@ -96,25 +96,45 @@ export default {
}
}
menuFun(menu)
const treeData = menuData.map(item => ({
id: item.id,
parentId: item.parentId,
label: item.name,
href: item.href,
icon: item.iconHref,
isCollage: true,
belong: item.belong,
isUrl: item.isUrl
}))
// 去重
const obj = {}
treeData.forEach(item => {
obj[item.id] = item
})
if(menuData.length==0){
this.$api.login.logout().then(_ => {
this.$message.warning('暂无权限,请联系管理员授权')
this.$store.commit('saveUserInfo', null)
this.$store.commit('setHandleProcess', null)
this.$store.commit('savePathUrl', null)
this.$store.commit('removeDicts', null)
// var sevice = "http://"+window.location.host+"/";
// var serviceUrl = encodeURIComponent(sevice);
// 正式
// window.open("https://caddmuat.changan.com.cn/cas/logout?service=http://10.64.23.30:7766/home", '_self');
// 测试
// window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self');
this.$router.push('/login')
})
return
}else{
const treeData = menuData.map(item => ({
id: item.id,
parentId: item.parentId,
label: item.name,
href: item.href,
icon: item.iconHref,
isCollage: true,
belong: item.belong,
isUrl: item.isUrl
}))
// 去重
const obj = {}
treeData.forEach(item => {
obj[item.id] = item
})
this.$store.commit('saveMenuData', Object.values(obj))
this.menuAllDate = Object.values(obj)
this.getMenu()
this.menuAllDate = Object.values(obj)
this.getMenu()
}
})
}
},