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

如果一个人多个role,怎么表示呢 #461

Open
xianchao888 opened this issue May 4, 2024 · 1 comment
Open

如果一个人多个role,怎么表示呢 #461

xianchao888 opened this issue May 4, 2024 · 1 comment

Comments

@xianchao888
Copy link

user的结构如下,如果一个人多个role,怎么办呢?
{
username: 'admin',
password: 'admin',
role: 'admin',
roleId: '1',
permissions: ['..*']
}

@charlestang
Copy link

我觉得,这个你自己声明一个新的 UserInfo 就好了。

export interface UserInfo {
  access: string[]
  avatar: string
  email: string
  name: string
  roles: UserRole[]
  roles_values: string[]
  subjects: string[] | null
  user_id: number
}

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

2 participants