mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:26:21 +00:00
fix: user current role (#232)
This commit is contained in:
parent
d98714d9fd
commit
264a1e6c21
@ -24,7 +24,7 @@ function setCurrentRole(ctx, user) {
|
||||
userRole = userRoles[0].get('name');
|
||||
} else if (userRoles.length > 1) {
|
||||
const defaultRole = userRoles.findIndex((role) => role.get('rolesUsers').default);
|
||||
userRole = defaultRole !== -1 ? userRoles[defaultRole] : userRoles[0];
|
||||
userRole = (defaultRole !== -1 ? userRoles[defaultRole] : userRoles[0]).get('name');
|
||||
}
|
||||
|
||||
if (userRole) {
|
||||
|
Loading…
Reference in New Issue
Block a user