REST API
概述
Rest API
返回值接口规范
名称 | 位置 | 类型 | 说明 |
---|---|---|---|
request_id | body | string | 请求唯一标识符id |
status | body | string | 请求是否成功Success /Failed |
error_code | body | string | 异常码,status为Failed 时存在 |
error_message | body | string | 异常消息,status为Failed 时存在 |
detail_message | body | string | 详细异常信息,status为Failed 时可能存在 |
data | body | object | 返回结果数据,一般在status为Success 时存在 |
登录认证
POST 令牌刷新
POST /oauth2/token
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
body | body | object | 否 | none |
» refresh_token | body | string | 否 | none |
» grant_type | body | string | 否 | none |
» client_id | body | string | 否 | none |
» client_secret | body | string | 否 | none |
» username | body | string | 否 | none |
» password | body | string | 否 | none |
Body 请求参数
refresh_token: string
grant_type: password
client_id: iab
client_secret: milesight*iab
username: string
password: string
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
返回示例
200 Response
{
"access_token": "string",
"expires_in": 0,
"refresh_token:":"string"
}
POST 用户注册
POST /user/register
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
body | body | object | 否 | none |
body | string | 是 | none | |
» nickname | body | string | 是 | none |
» password | body | string | 是 | none |
Body 请求参数
{
"email": "string",
"nickname": "string",
"password": "string"
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
返回示例
200 Response
{}
GET 获取用户信息
GET /user
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
返回示例 200 Response
{
"data": {
"tenant_id": "string",
"user_id": "string",
"nickname": "string",
"email": "string",
"created_at": "string",
"roles": [{
"role_id": "string",
"role_name": "string"
}],
"menus": [
{
"menu_id": "",
"code": "",
"name": "",
"type": "",
"parent_id":""
}
],
"super_admin": true
}
}