用户登录密码验证
POST /v1/api/user/login
通过此接口用于登录系统,相当于可以校验用户名密码。
Name |
Required |
Type |
Description |
x-api-tenantId |
yes |
string |
租户编号 |
x-api-token |
yes |
string |
认证token |
x-language |
no |
string |
语言,zh-CN、en-US |
Request Parameters
Name |
Required |
Type |
Description |
email |
yes |
string |
用户编号 |
password |
yes |
string |
配置的MT Server编号 |
Response
Name |
Type |
Description |
result |
boolean |
成功标识,返回true,表示请求成功,false表示请求失败 |
mcode |
string |
错误码,成功时返回m00000,失败时返回对应的错误码,见文档默认错误码说明 |
data |
object |
数据 |
message |
string |
错误提示信息,部分错误码时有值 |
1、data数据类型
Name |
Type |
Description |
userId |
number |
用户id |
lastLoginTime |
number |
上次登录时间 |
Example
请求示例
POST /v1/api/user/login
{
"email":"[email protected]",
"password":"Abcd1234"
}
返回示例:成功
{
"data": {
"lastLoginTime": 1574908245729,
"userId": 85
},
"mcode": "m0000000",
"result": true,
"time": 1575366465006
}
返回示例:失败
{
"mcode":"m0000001",
"message":"",
"result":false,
"time":1575366245727
}
2. Error 错误处理
错误码表(Error Code)
mcode |
Message |
BW_REPORT_0000 |
参数错误 |
RIGHT_NO_00000001 |
没有权限查看此数据 |
BW_REPORT_0022 |
用户不存在 |
BW_REPORT_0023 |
serverId不存在 |
-1 |
服务异常,请稍后再试 |