代码规范性调整
This commit is contained in:
@@ -52,7 +52,7 @@ export default {
|
||||
})
|
||||
this.activeUserId = this.row.authorityId
|
||||
this.apiTreeIds = []
|
||||
res.data.paths && res.data.paths.map(item => {
|
||||
res.data.paths && res.data.paths.forEach(item => {
|
||||
this.apiTreeIds.push('p:' + item.path + 'm:' + item.method)
|
||||
})
|
||||
},
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
buildApiTree(apis) {
|
||||
const apiObj = {}
|
||||
apis &&
|
||||
apis.map(item => {
|
||||
apis.forEach(item => {
|
||||
item.onlyId = 'p:' + item.path + 'm:' + item.method
|
||||
if (Object.prototype.hasOwnProperty.call(apiObj, item.apiGroup)) {
|
||||
apiObj[item.apiGroup].push(item)
|
||||
@@ -91,7 +91,7 @@ export default {
|
||||
async authApiEnter() {
|
||||
const checkArr = this.$refs.apiTree.getCheckedNodes(true)
|
||||
var casbinInfos = []
|
||||
checkArr && checkArr.map(item => {
|
||||
checkArr && checkArr.forEach(item => {
|
||||
var casbinInfo = {
|
||||
path: item.path,
|
||||
method: item.method
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
this.authoritys = []
|
||||
this.dataAuthorityId = []
|
||||
this.roundAuthority(this.authority)
|
||||
this.row.dataAuthorityId && this.row.dataAuthorityId.map(item => {
|
||||
this.row.dataAuthorityId && this.row.dataAuthorityId.forEach(item => {
|
||||
const obj = this.authoritys && this.authoritys.filter(au => au.authorityId === item.authorityId) && this.authoritys.filter(au => au.authorityId === item.authorityId)[0]
|
||||
this.dataAuthorityId.push(obj)
|
||||
})
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
getChildrenId(row, arrBox) {
|
||||
arrBox.push(row.authorityId)
|
||||
row.children && row.children.map(item => {
|
||||
row.children && row.children.forEach(item => {
|
||||
this.getChildrenId(item, arrBox)
|
||||
})
|
||||
},
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
},
|
||||
// 平铺角色
|
||||
roundAuthority(authoritys) {
|
||||
authoritys && authoritys.map(item => {
|
||||
authoritys && authoritys.forEach(item => {
|
||||
const obj = {}
|
||||
obj.authorityId = item.authorityId
|
||||
obj.authorityName = item.authorityName
|
||||
|
||||
@@ -70,7 +70,7 @@ export default {
|
||||
const res1 = await getMenuAuthority({ authorityId: this.row.authorityId })
|
||||
const menus = res1.data.menus
|
||||
const arr = []
|
||||
menus.map(item => {
|
||||
menus.forEach(item => {
|
||||
// 防止直接选中父级造成全选
|
||||
if (!menus.some(same => same.parentId === item.menuId)) {
|
||||
arr.push(Number(item.menuId))
|
||||
|
||||
Reference in New Issue
Block a user