Skip to content

Conversation

@AimWhy
Copy link

@AimWhy AimWhy commented Dec 27, 2018

getRoles和getPermissions方法获取数据的方式有问题
this.items 是Object 而不是 Array
需要通过Object.keys(this.items).forEach

getRoles和getPermissions方法获取数据的方式有问题
this.items 是Object 而不是 Array
需要通过Object.keys(this.items).forEach
Copy link

@ssipos90 ssipos90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's simpler if you just use Object.values instead of iterating the keys.

}

async getRoles(): Role[] {
return this.items
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.values(this.items)

}

async getPermissions(): Permission[] {
return this.items
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.values(this.items)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants