fix: 解决bug
This commit is contained in:
+3
-2
@@ -275,6 +275,7 @@ function normalizeUser(item: unknown, index: number): UserListItem {
|
||||
const name = getString(record, ['name', 'real_name', 'realName', 'nickname', 'username'], `用户${index + 1}`)
|
||||
const roleType = getString(record, ['role_type', 'roleType', 'role'], '')
|
||||
const status = getStatus(record)
|
||||
const institutionId = getString(record, ['institution', 'institution_id', 'institutionId'], '')
|
||||
|
||||
return {
|
||||
id: getString(record, ['id', 'uuid', 'user_id', 'userId'], `${index}`),
|
||||
@@ -282,7 +283,7 @@ function normalizeUser(item: unknown, index: number): UserListItem {
|
||||
account: getString(record, ['account', 'username', 'phone', 'mobile', 'email'], name),
|
||||
role: getString(record, ['role_name', 'roleName', 'role', 'role_type', 'roleType']),
|
||||
roleType,
|
||||
org: getString(record, ['org', 'organization', 'organization_name', 'organizationName', 'hospital', 'hospital_name', 'hospitalName']),
|
||||
org: getString(record, ['org', 'organization', 'organization_name', 'organizationName', 'institution_name', 'institutionName', 'hospital', 'hospital_name', 'hospitalName'], institutionId || '-'),
|
||||
lastLogin: getString(record, ['last_login', 'lastLogin', 'login_time', 'loginTime']),
|
||||
enabled: getBoolean(record, ['enabled', 'is_active', 'isActive', 'status']),
|
||||
phone: getString(record, ['phone', 'mobile', 'account', 'username'], ''),
|
||||
@@ -292,7 +293,7 @@ function normalizeUser(item: unknown, index: number): UserListItem {
|
||||
major: getString(record, ['major']),
|
||||
trainingStage: getString(record, ['training_stage', 'trainingStage']),
|
||||
status,
|
||||
institutionId: getString(record, ['institution', 'institution_id', 'institutionId'])
|
||||
institutionId
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user