feat(auth): 添加请求参数校验支持
- 在 AuthController 中为注册和登录接口添加 @Validated 注解 - 更新 DeviceController、RoleController 和 UserController 中的相关接口以支持参数校验 - 修改 AuthLoginRequest 中用户名校验的错误提示信息
This commit is contained in:
@@ -8,7 +8,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class AuthLoginRequest {
|
||||
@Pattern(regexp = "^[a-zA-Z0-9_-]{5,16}$", message = "用户名需为5-16位字母、数字、_或-")
|
||||
@Pattern(regexp = "^[a-zA-Z0-9_-]{5,16}$", message = "用户名校验失败")
|
||||
private String username;
|
||||
@Pattern(regexp = "^.{8,16}$", message = "密码长度需为8-16位")
|
||||
private String password;
|
||||
|
||||
Reference in New Issue
Block a user