kailong321200875 / vue-element-plus-admin

A backend management system based on vue3, typescript, element-plus, and vite
https://element-plus-admin.cn/
MIT License
2.81k stars 682 forks source link

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

Open xianchao888 opened 6 months ago

xianchao888 commented 6 months ago

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

charlestang commented 6 months ago

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

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