Login a user
post
/api/user/loginRegistered users can login using the API described below.
Request
Body application/json
usernamestring
The username.
passwordstring
The password, encrypted with SHA256 and converted to lower case.
Response
Schema:
application/jsonBody application/json
json
{
"code": "0",
"data": {
"token": "TOKEN STRING"
},
"message": "Ok"
}{
"code": "0",
"data": {
"token": "TOKEN STRING"
},
"message": "Ok"
}json
// USER_NOT_FOUND
{
"code": "101",
"message": "User not found"
}// USER_NOT_FOUND
{
"code": "101",
"message": "User not found"
}json
// USER_PASSWORD_NOT_MATCH
{
"code": "103",
"message": "User password do not match"
}// USER_PASSWORD_NOT_MATCH
{
"code": "103",
"message": "User password do not match"
}json
// USER_LOGIN_FAILED
{
"code": "107",
"message": "User login failed"
}// USER_LOGIN_FAILED
{
"code": "107",
"message": "User login failed"
}