diff --git a/src/modules/rag/Application/Auth/Validators/LoginCommandValidator.cs b/src/modules/rag/Application/Auth/Validators/LoginCommandValidator.cs index e929667..022b974 100644 --- a/src/modules/rag/Application/Auth/Validators/LoginCommandValidator.cs +++ b/src/modules/rag/Application/Auth/Validators/LoginCommandValidator.cs @@ -13,6 +13,7 @@ public class LoginCommandValidator : AbstractValidator RuleFor(x => x.Username).NotEmpty().WithMessage("用户名不能为空") .MaximumLength(50).WithMessage("用户名长度不能超过 50 个字符") .Must(u => u == u.Trim()).WithMessage("用户名前后不能有空格"); + RuleFor(x => x.Password).NotEmpty().WithMessage("密码不能为空") .MaximumLength(100).WithMessage("密码长度不能超过 100 个字符"); } diff --git a/src/modules/rag/Application/Auth/Validators/RegisterCommandValidator.cs b/src/modules/rag/Application/Auth/Validators/RegisterCommandValidator.cs index 95c5b9f..c2d1efe 100644 --- a/src/modules/rag/Application/Auth/Validators/RegisterCommandValidator.cs +++ b/src/modules/rag/Application/Auth/Validators/RegisterCommandValidator.cs @@ -12,9 +12,11 @@ public class RegisterCommandValidator : AbstractValidator { RuleFor(x => x.Username).NotEmpty().WithMessage("用户名不能为空") .Length(3, 50).WithMessage("用户名长度 3-50 个字符"); + RuleFor(x => x.Email).NotEmpty().WithMessage("邮箱不能为空") .EmailAddress().WithMessage("邮箱格式不正确"); + RuleFor(x => x.Password).NotEmpty().WithMessage("密码不能为空") .Length(6, 100).WithMessage("密码长度 6-100 个字符"); } -} +} \ No newline at end of file