mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 05:50:18 +08:00
14 lines
296 B
TypeScript
14 lines
296 B
TypeScript
export function adapterOfFetchUserList(data: ApiUserManagement.User[] | null): UserManagement.User[] {
|
|
if (!data) return [];
|
|
|
|
return data.map((item, index) => {
|
|
const user: UserManagement.User = {
|
|
index: index + 1,
|
|
key: item.id,
|
|
...item
|
|
};
|
|
|
|
return user;
|
|
});
|
|
}
|