修复了api唯一key关联的bug,修复了角色删除失败的bug

This commit is contained in:
pixel
2020-04-13 17:45:33 +08:00
parent 959aa9cd38
commit f68947d50e
5 changed files with 22 additions and 16 deletions
@@ -9,7 +9,7 @@
:props="apiDefaultProps"
default-expand-all
highlight-current
node-key="path"
node-key="onlyId"
ref="apiTree"
show-checkbox
></el-tree>
@@ -44,6 +44,7 @@ export default {
const apiObj = new Object()
apis &&
apis.map(item => {
item.onlyId = "p:"+item.path+"m:"+item.method
if (apiObj.hasOwnProperty(item.apiGroup)) {
apiObj[item.apiGroup].push(item)
} else {
@@ -85,13 +86,16 @@ export default {
// 获取api并整理成树结构
const res2 = await getAllApis()
const apis = res2.data.apis
this.apiTreeData = this.buildApiTree(apis)
const res = await getPolicyPathByAuthorityId({
authorityId: this.row.authorityId
})
this.activeUserId = this.row.authorityId
this.apiTreeIds = res.data.paths || []
this.apiTreeIds = []
res.data.paths&&res.data.paths.map(item=>{
this.apiTreeIds.push("p:"+item.path+"m:"+item.method)
})
}
}
</script>