Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Memory.js #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update Memory.js #47

wants to merge 1 commit into from

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.

@@ -94,9 +94,10 @@ export default class Memory extends Storage {
}

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)

@@ -107,9 +108,10 @@ export default class Memory extends Storage {
}

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