feat(users): update bulk add users field name

This commit is contained in:
LinkinStars 2023-08-14 18:30:11 +08:00
parent 1cd4e2740d
commit 236b1f797a
1 changed files with 3 additions and 3 deletions

View File

@ -201,7 +201,7 @@ func (us *UserAdminService) formatBulkAddUsers(ctx context.Context, req *schema.
break
}
if existDisplayNames[user.DisplayName] {
errorData.Field = "displayName"
errorData.Field = "name"
errorData.Line = line + 1
errorData.Content = user.DisplayName
errorData.ExtraMessage = translator.Tr(lang, reason.UsernameDuplicate)
@ -211,7 +211,7 @@ func (us *UserAdminService) formatBulkAddUsers(ctx context.Context, req *schema.
if fields, e := val.Check(user); e != nil {
errorData.SetErrField(fields)
errorData.Line = line + 1
errorData.Content = fmt.Sprintf("%s, %s", user.DisplayName, user.Email)
errorData.Content = fmt.Sprintf("%s, %s, %s", user.DisplayName, user.Email, user.Password)
break
}
@ -234,7 +234,7 @@ func (us *UserAdminService) formatBulkAddUsers(ctx context.Context, req *schema.
userInfo.Pass = string(hashPwd)
userInfo.Username, err = us.userCommonService.MakeUsername(ctx, userInfo.DisplayName)
if err != nil {
errorData.Field = "display_name"
errorData.Field = "name"
errorData.Line = line + 1
errorData.Content = user.DisplayName
errorData.ExtraMessage = translator.Tr(lang, reason.UsernameInvalid)