6. 用户管理

6.1. 用户注册

Type: POST

Author: xezzon

Content-Type: application/json

Description: 用户注册

Body-parameters:

Parameter Type Description Required Since

username

string

用户名
Validation[Pattern(regexp=^\\w{3,32}$, message=用户名必须是3~32位 小写字母/数字/下划线 组成的字符串) ]

false

-

nickname

string

用户昵称

false

-

password

string

密码
为了防止身份被冒用,由用户设置的、只有用户自己知晓的口令。
Validation[Pattern(regexp=^(?!^\\d+$)(?!^[a-z]+$)(?!^[A-Z]+$)[\\x21-\\x7E]{8,}$, message=密码由至少8位有效字符构成,且不允许是纯数字、纯小写或者纯大写字母) ]

false

-

Request-example:

curl -X POST -H "Content-Type: application/json" -i 'http://127.0.0.1/user/register' --data '{
  "username": "",
  "nickname": "",
  "password": ""
}'

Response-fields:

Field Type Description Since

id

string

No comments found.

-

Response-example:

{
  "id": ""
}