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

关于本系统的用户RoleInfo #259

Closed
worldofchu opened this issue Feb 9, 2021 · 2 comments
Closed

关于本系统的用户RoleInfo #259

worldofchu opened this issue Feb 9, 2021 · 2 comments

Comments

@worldofchu
Copy link

   userId: '1',
  username: 'vben',
  realName: 'Vben Admin',
  desc: 'manager',
  password: '123456',
  token: 'fakeToken1',
  role: {
    roleName: 'Super Admin',
    value: 'super',
  },

这里 的role 字段 应该是个集合把 ,一个用户应该有多个角色的!!!

Problem

If the feature requests relates to a problem, please describe the problem you are trying to solve here.

Expected behaviour

What should happen? Please describe the desired behaviour.

Alternatives

What are the alternative solutions? Please describe what else you have considered?

@mynetfan
Copy link
Collaborator

mynetfan commented Feb 9, 2021

我也觉得这里应该是这样的:

  username: 'vben',
  realName: 'Vben Admin',
  desc: 'manager',
  password: '123456',
  token: 'fakeToken1',
  roles:[
    {roleName:'Role1',value:'role1'},
    {roleName:'Role2',value:'role2'}
  ],

@anncwb
Copy link
Collaborator

anncwb commented Feb 9, 2021

这里只是模拟数据,到最后还是转成了数组。这个我可以调整下

 @Action
  async getUserInfoAction({ userId }: GetUserInfoByUserIdParams) {
    const userInfo = await getUserInfoById({ userId });
    const { role } = userInfo;
    const roleList = [role.value] as RoleEnum[];
    this.commitUserInfoState(userInfo);
    this.commitRoleListState(roleList);
    return userInfo;
  }

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

No branches or pull requests

3 participants