A AuthMS API Wiki API Reference iam.tianv.com →

POST /auth/register/check-username

在用户注册前校验用户名是否已被占用,防止批量注册和冲突。支持GET和POST两种请求方式。参考:OWASP ASVS V2.2。

身份认证 None application/json

Request Parameters

NameInTypeRequiredDefaultExampleConstraintsDescription
username query string No 用户名(GET方式)

Request Body

Schema: dto.CheckUsernameRequest

FieldTypeRequiredExampleConstraintsDescription
username string Yes john_doe Username

Responses

StatusDescriptionSchema
200用户名可用性检查结果dto.CheckUsernameResponse
400请求参数无效gitee_com_linmes_authms_base_dto.SimpleResponse
500服务器内部错误gitee_com_linmes_authms_base_dto.SimpleResponse

Referenced Schemas

dto.CheckUsernameResponse

检查用户名可用性结果

FieldTypeRequiredExampleConstraintsDescription
available boolean No True Is available
username string No john_doe Username

gitee_com_linmes_authms_base_dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No