fix(system): 修复用户账号校验逻辑

- 将 UserSaveReqVO 类中的 username 字段的正则表达式从 "^[a-zA-Z0-9]$" 修改为 "^[a-zA-Z0-9]+$"
- 修复了用户账号仅能输入一个字母或数字的问题
- 现在用户账号可以由多个字母或数字组成,长度为 4-30 个字符
pull/167/head
Song 2025-01-17 12:15:20 +08:00
parent e4f0cb7f60
commit b674bb072a
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ public class UserSaveReqVO {
@Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao")
@NotBlank(message = "用户账号不能为空")
@Pattern(regexp = "^[a-zA-Z0-9]$", message = "用户账号由 数字、字母 组成")
@Pattern(regexp = "^[a-zA-Z0-9]+$", message = "用户账号由 数字、字母 组成")
@Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符")
@DiffLogField(name = "用户账号")
private String username;