| icon | iconfont icon-token | ||
|---|---|---|---|
| order | 2 | ||
| category |
|
||
| tag |
|
||
| sticky | true | ||
| star | true |
POST /api/auth/login
获取某个用户的临时JWt token, 有效期默认48小时
Body 请求参数
{
"Username": "{{alist_username}}",
"Password": "{{alist_password}}"
}| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| body | body | object | 否 | none | |
| » Username | body | string | 是 | 用户名 | 用户名 |
| » Password | body | string | 是 | 密码 | 密码 |
| » otp_code | body | string | 否 | 二步验证码 | 二步验证码 |
成功
{
"code": 200,
"message": "success",
"data": {
"token": "abcd"
}
}| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | 状态码 | |
| » message | string | true | none | 信息 | |
| » data | object | true | none | data | |
| »» token | string | true | none | token |
POST /api/auth/login/hash
获取某个用户的临时JWt token,传入的密码需要在添加-https://github.com/alist-org/alist后缀后再进行sha256
Body 请求参数
{
"username": "{{alist_username}}",
"password": "{{alist_password}}"
}| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| body | body | object | 否 | none | |
| » username | body | string | 是 | 用户名 | 用户名 |
| » password | body | string | 是 | 密码 | hash后密码,获取方式为sha256(密码-https://github.com/alist-org/alist) |
| » otp_code | body | string | 否 | 二步验证码 | 二步验证码 |
成功
{
"code": 200,
"message": "success",
"data": {
"token": "abcd"
}
}| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | 状态码 | |
| » message | string | true | none | 信息 | |
| » data | object | true | none | data | |
| »» token | string | true | none | token |
POST /api/auth/2fa/generate
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 是 | none |
成功
{
"code": 200,
"message": "success",
"data": {
"qr": "data:image/png;base64,iVBORw0KGgoAAAANSUhE",
"secret": "RPQZG4MDS3"
}
}| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | 状态码 | none |
| » message | string | true | none | 信息 | none |
| » data | object | true | none | 数据 | none |
| »» qr | string | true | none | 二维码 | 二维码图片的data url |
| »» secret | string | true | none | 密钥 | none |
POST /api/auth/2fa/verify
Body 请求参数
{
"code": "string",
"secret": "string"
}| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 是 | none | |
| body | body | object | 否 | none | |
| » code | body | string | 是 | 2FA验证码 | none |
| » secret | body | string | 是 | 2FA密钥 | none |
成功
{
"code": 200,
"message": "success",
"data": null
}| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | 状态码 | none |
| » message | string | true | none | 信息 | none |
| » data | null | true | none | none |
GET /api/me
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 否 | none |
成功
{
"code": 200,
"message": "success",
"data": {
"id": 1,
"username": "admin",
"password": "",
"base_path": "/",
"role": 2,
"disabled": false,
"permission": 0,
"sso_id": "",
"otp": true
}
}| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | 状态码 | none |
| » message | string | true | none | 信息 | none |
| » data | object | true | none | 数据 | none |
| »» id | integer | true | none | id | none |
| »» username | string | true | none | 用户名 | none |
| »» password | string | true | none | 密码 | none |
| »» base_path | string | true | none | 根目录 | none |
| »» role | integer | true | none | 角色 | none |
| »» disabled | boolean | true | none | 是否禁用 | none |
| »» permission | integer | true | none | 权限 | none |
| »» sso_id | string | true | none | sso id | none |
| »» otp | boolean | true | none | 是否开启二步验证 | none |