## 1. Project Overview & Quickstart (OpenListTeam/LICENSE)

# LICENSE

Open-source repository OpenListTeam/LICENSE

### Repository Details
- **Repository:** [OpenListTeam/LICENSE](https://github.com/OpenListTeam/LICENSE)
- **Primary Language:** Code

*Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.*

## 2. Official Technical Reference & Guides (OpenListTeam/docs)

## File: docs/guide/api/admin/driver.md

---
# This is the icon of the page
icon: iconfont icon-file
# This control sidebar order
order: 3
# A page can have multiple categories
category:
  - Guide
# A page can have multiple tags
tag:
  - ADMIN
  - API
  - Guide
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---

# driver

## GET 查询所有驱动配置模板列表

GET /api/admin/driver/list

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明  |
| ------------- | ------ | ------ | ---- | ----- |
| Authorization | header | string | 是   | token |

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

由于列表过长，请自行获取查看。

## GET 列出驱动名列表

GET /api/admin/driver/names

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明  |
| ------------- | ------ | ------ | ---- | ----- |
| Authorization | header | string | 是   | token |

### 返回示例

> 成功

```json
{
    "code": 200,
    "message": "success",
    "data": [
        "IPFS API",
        "BaiduPhoto",
        "Onedrive",
        "PikPakShare",
        "Seafile",
        "OpenList V3",
        "Alias",
        "Crypt",
        "123PanLink",
        "ChaoXingGroupDrive",
        "OnedriveAPP",
        "Teambition",
        "WoPan",
        "ThunderExpert",
        "Mega_nz",
        "123PanShare",
        "Cloudreve",
        "UC",
        "115 Share",
        "MoPan",
        "AliyundriveOpen",
        "GooglePhoto",
        "UrlTree",
        "ILanZou",
        "189Cloud",
        "Local",
        "139Yun",
        "BaiduNetdisk",
        "Quqi",
        "115 Cloud",
        "FeijiPan",
        "S3",
        "Thunder",
        "PikPak",
        "Aliyundrive",
        "Dropbox",
        "NeteaseMusic",
        "WeiYun",
        "123Pan",
        "Doge",
        "189CloudPC",
        "GoogleDrive",
        "Quark",
        "YandexDisk",
        "MediaTrack",
        "OpenList V2",
        "Virtual",
        "USS",
        "AliyundriveShare",
        "Lanzou",
        "WebDav",
        "VTencent",
        "Trainbit",
        "FTP",
        "SFTP",
        "SMB",
        "Terabox"
    ]
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型     | 必选 | 约束 | 中文名 | 说明   |
| --------- | -------- | ---- | ---- | ------ | ------ |
| » code    | integer  | true | none | 状态码 | 状态码 |
| » message | string   | true | none | 信息   | 信息   |
| » data    | [string] | true | none |        | none   |

## GET 列出特定驱动信息

GET /api/admin/driver/info

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明  |
| ------------- | ------ | ------ | ---- | ----- |
| driver        | query  | string | 是   | none  |
| Authorization | header | string | 是   | token |

### 返回示例

> 成功

```
/* Detailed source-code truncated for AI context efficiency. */
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称             | 类型     | 必选 | 约束 | 中文名       | 说明   |
| ---------------- | -------- | ---- | ---- | ------------ | ------ |
| » code           | integer  | true | none | 状态码       | 状态码 |
| » message        | string   | true | none | 信息         | 信息   |
| » data           | object   | true | none |              | none   |
| »» common        | [object] | true | none | 通用配置     | none   |
| »»» name         | string   | true | none | 配置名       | none   |
| »»» type         | string   | true | none | 类型         | none   |
| »»» default      | string   | true | none | 默认值       | none   |
| »»» options      | string   | true | none | 选项         | none   |
| »»» required     | boolean  | true | none | 是否必须     | none   |
| »»» help         | string   | true | none | 帮助信息     | none   |
| »» additional    | [object] | true | none | 额外配置     | none   |
| »»» name         | string   | true | none | 配置名       | none   |
| »»» type         | string   | true | none | 类型         | none   |
| »»» default      | string   | true | none | 默认值       | none   |
| »»» options      | string   | true | none | 选项         | none   |
| »»» required     | boolean  | true | none | 是否必须     | none   |
| »»» help         | string   | true | none | 帮助信息     | none   |
| »» config        | object   | true | none | 配置         | none   |
| »»» name         | string   | true | none | 配置名       | none   |
| »»» local_sort   | boolean  | true | none | 本地排序     | none   |
| »»» only_local   | boolean  | true | none | 仅本地       | none   |
| »»» only_proxy   | boolean  | true | none | 仅代理       | none   |
| »»» no_cache     | boolean  | true | none | 无缓存       | none   |
| »»» no_upload    | boolean  | true | none | 无上传       | none   |
| »»» need_ms      | boolean  | true | none |              | none   |
| »»» default_root | string   | true | none | 默认基本路径 | none   |
| »»» alert        | string   | true | none | 警告信息     | none   |

---

## File: docs/guide/api/admin/meta.md

---
# This is the icon of the page
icon: iconfont icon-token
# This control sidebar order
order: 2
# A page can have multiple categories
category:
  - Guide
# A page can have multiple tags
tag:
  - ADMIN
  - API
  - Guide
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---

# meta

## GET 列出元信息

GET /api/admin/meta/list

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明     |
| ------------- | ------ | ------ | ---- | -------- |
| page          | query  | string | 否   | 页数     |
| per_page      | query  | string | 否   | 每页个数 |
| Authorization | header | string | 是   | none     |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "id": 1,
        "path": "/a",
        "password": "i",
        "p_sub": false,
        "write": false,
        "w_sub": false,
        "hide": "",
        "h_sub": false,
        "readme": "",
        "r_sub": false
      }
    ],
    "total": 1
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称         | 类型     | 必选  | 约束 | 中文名                     | 说明 |
| ------------ | -------- | ----- | ---- | -------------------------- | ---- |
| » code       | integer  | true  | none | 状态码                     | none |
| » message    | string   | true  | none | 信息                       | none |
| » data       | object   | true  | none | 数据                       | none |
| »» content   | [object] | true  | none | 内容                       | none |
| »»» id       | integer  | false | none | id                         | none |
| »»» path     | string   | false | none | 路径                       | none |
| »»» password | string   | false | none | 密码                       | none |
| »»» p_sub    | boolean  | false | none | 密码是否应用到子文件夹     | none |
| »»» write    | boolean  | false | none | 是否允许写入               | none |
| »»» w_sub    | boolean  | false | none | 是否允许写入引用到子文件夹 | none |
| »»» hide     | string   | false | none | 隐藏                       | none |
| »»» h_sub    | boolean  | false | none | 隐藏是否应用到子文件夹     | none |
| »»» readme   | string   | false | none | 说明                       | none |
| »»» r_sub    | boolean  | false | none | 说明是否应用到子文件夹     | none |
| »» total     | integer  | true  | none | 总数                       | none |

## GET 获取元信息

GET /api/admin/meta/get

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明     |
| ------------- | ------ | ------ | ---- | -------- |
| id            | query  | string | 是   | 元信息id |
| Authorization | header | string | 是   | none     |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "id": 1,
    "path": "/a",
    "password": "c",
    "p_sub": false,
    "write": false,
    "w_sub": false,
    "hide": "",
    "h_sub": false,
    "readme": "",
    "r_sub": false
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称        | 类型    | 必选 | 约束 | 中文名                     | 说明 |
| ----------- | ------- | ---- | ---- | -------------------------- | ---- |
| » code      | integer | true | none | 状态码                     | none |
| » message   | string  | true | none | 信息                       | none |
| » data      | object  | true | none |                            | none |
| »» id       | integer | true | none | id                         | none |
| »» path     | string  | true | none | 路径                       | none |
| »» password | string  | true | none | 密码                       | none |
| »» p_sub    | boolean | true | none | 密码是否应用到子文件夹     | none |
| »» write    | boolean | true | none | 开启写入                   | none |
| »» w_sub    | boolean | true | none | 开启写入是否应用到子文件夹 | none |
| »» hide     | string  | true | none | 隐藏                       | none |
| »» h_sub    | boolean | true | none | 隐藏是否应用到子文件夹     | none |
| »» readme   | string  | true | none | 说明                       | none |
| »» r_sub    | boolean | true | none | 说明是否应用到子文件夹     | none |

## POST 新增元信息

POST /api/admin/meta/create

> Body 请求参数

```json
{
  "id": 0,
  "path": "/a",
  "password": "c",
  "p_sub": false,
  "write": false,
  "w_sub": false,
  "hide": "",
  "h_sub": false,
  "readme": "",
  "r_sub": false
}
```

### 请求参数

| 名称          | 位置   | 类型    | 必选 | 中文名                     | 说明 |
| ------------- | ------ | ------- | ---- | -------------------------- | ---- |
| Authorization | header | string  | 是   |                            | none |
| body          | body   | object  | 否   |                            | none |
| » id          | body   | integer | 是   | id                         | none |
| » path        | body   | string  | 是   | 路径                       | none |
| » password    | body   | string  | 是   | 密码                       | none |
| » p_sub       | body   | boolean | 是   | 密码是否应用到子文件夹     | none |
| » write       | body   | boolean | 是   | 开启写入                   | none |
| » w_sub       | body   | boolean | 是   | 开启写入是否应用到子文件夹 | none |
| » hide        | body   | string  | 是   | 隐藏                       | none |
| » h_sub       | body   | boolean | 是   | 隐藏是否应用到子文件夹     | none |
| » readme      | body   | string  | 是   | 说明                       | none |
| » r_sub       | body   | boolean | 是   | 说明是否应用到子文件夹     | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none |        | none |
| » message | string  | true | none |        | none |
| » data    | null    | true | none |        | none |

## POST 更新元信息

POST /api/admin/meta/update

> Body 请求参数

```json
{
  "id": 0,
  "path": "/a",
  "password": "c",
  "p_sub": false,
  "write": false,
  "w_sub": false,
  "hide": "",
  "h_sub": false,
  "readme": "",
  "r_sub": false
}
```

### 请求参数

| 名称          | 位置   | 类型    | 必选 | 中文名                     | 说明 |
| ------------- | ------ | ------- | ---- | -------------------------- | ---- |
| Authorization | header | string  | 是   |                            | none |
| body          | body   | object  | 否   |                            | none |
| » id          | body   | integer | 是   | id                         | none |
| » path        | body   | string  | 是   | 路径                       | none |
| » password    | body   | string  | 是   | 密码                       | none |
| » p_sub       | body   | boolean | 是   | 密码是否应用到子文件夹     | none |
| » write       | body   | boolean | 是   | 开启写入                   | none |
| » w_sub       | body   | boolean | 是   | 开启写入是否应用到子文件夹 | none |
| » hide        | body   | string  | 是   | 隐藏                       | none |
| » h_sub       | body   | boolean | 是   | 隐藏是否应用到子文件夹     | none |
| » readme      | body   | string  | 是   | 说明                       | none |
| » r_sub       | body   | boolean | 是   | 说明是否应用到子文件夹     | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none |        | none |
| » message | string  | true | none |        | none |
| » data    | null    | true | none |        | none |

## POST 删除元信息

POST /api/admin/meta/delete

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| id            | query  | string | 是   |        | none |
| Authorization | header | string | 是   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

---

## File: docs/guide/api/admin/setting.md

---
# This is the icon of the page
icon: iconfont icon-setting
# This control sidebar order
order: 5
# A page can have multiple categories
category:
  - Guide
# A page can have multiple tags
tag:
  - ADMIN
  - API
  - Guide
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---
# setting

## GET 列出设置

GET /api/admin/setting/list

包括永久令牌

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明                                       |
| ------------- | ------ | ------ | ---- | ------------------------------------------ |
| groups        | query  | string | 否   | 5,0-其它设置，包括aria2和令牌等            |
| group         | query  | string | 否   | 1-站点；2-样式；3-预览；4-全局；7-单点登录 |
| Authorization | header | string | 否   | none                                       |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": [
    {
      "key": "aria2_uri",
      "value": "http://localhost:6800/jsonrpc",
      "help": "",
      "type": "string",
      "options": "",
      "group": 5,
      "flag": 1
    },
    {
      "key": "aria2_secret",
      "value": "",
      "help": "",
      "type": "string",
      "options": "",
      "group": 5,
      "flag": 1
    },
    {
      "key": "token",
      "value": "alist-2a",
      "help": "",
      "type": "string",
      "options": "",
      "group": 0,
      "flag": 1
    },
    {
      "key": "index_progress",
      "value": "{\"obj_count\":0,\"is_done\":true,\"last_done_time\":null,\"error\":\"\"}",
      "help": "",
      "type": "text",
      "options": "",
      "group": 0,
      "flag": 1
    },
    {
      "key": "qbittorrent_url",
      "value": "http://a:an@localhost:8080/",
      "help": "",
      "type": "string",
      "options": "",
      "group": 0,
      "flag": 1
    },
    {
      "key": "qbittorrent_seedtime",
      "value": "0",
      "help": "",
      "type": "number",
      "options": "",
      "group": 0,
      "flag": 1
    }
  ]
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称       | 类型     | 必选 | 约束 | 中文名   | 说明                                                  |
| ---------- | -------- | ---- | ---- | -------- | ----------------------------------------------------- |
| » code     | integer  | true | none | 状态码   | none                                                  |
| » message  | string   | true | none | 信息     | none                                                  |
| » data     | [object] | true | none |          | none                                                  |
| »» key     | string   | true | none | 键       | none                                                  |
| »» value   | string   | true | none | 值       | none                                                  |
| »» help    | string   | true | none | 帮助信息 | none                                                  |
| »» type    | string   | true | none | 类型     | string, number, bool, select                          |
| »» options | string   | true | none | 选项     | none                                                  |
| »» group   | integer  | true | none | 分组     | 用于前端分组                                          |
| »» flag    | integer  | true | none | 标志     | 0 = public, 1 = private, 2 = readonly, 3 = deprecated |

## GET 获取某项设置

GET /api/admin/setting/get

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明 |
| ------------- | ------ | ------ | ---- | ---- |
| keys          | query  | string | 否   | none |
| key           | query  | string | 否   | none |
| Authorization | header | string | 否   | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "key": "hide_files",
    "value": "/\\/README.md/i",
    "help": "",
    "type": "text",
    "options": "",
    "group": 4,
    "flag": 0
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称       | 类型    | 必选 | 约束 | 中文名   | 说明                                                  |
| ---------- | ------- | ---- | ---- | -------- | ----------------------------------------------------- |
| » code     | integer | true | none | 状态码   | none                                                  |
| » message  | string  | true | none | 信息     | none                                                  |
| » data     | object  | true | none |          | none                                                  |
| »» key     | string  | true | none | 键       | none                                                  |
| »» value   | string  | true | none | 值       | none                                                  |
| »» help    | string  | true | none | 帮助信息 | none                                                  |
| »» type    | string  | true | none | 类型     | string, number, bool, select                          |
| »» options | string  | true | none | 选项     | none                                                  |
| »» group   | integer | true | none | 分组     | none                                                  |
| »» flag    | integer | true | none | 标志     | 0 = public, 1 = private, 2 = readonly, 3 = deprecated |

## POST 保存设置

POST /api/admin/setting/save

> Body 请求参数

```json
[
  {
    "key": "version",
    "value": "v3.25.1",
    "help": "",
    "type": "string",
    "options": "",
    "group": 1,
    "flag": 2
  },
  {
    "key": "site_title",
    "value": "OpenList",
    "help": "",
    "type": "string",
    "options": "",
    "group": 1,
    "flag": 0
  },
  {
    "key": "announcement",
    "value": "",
    "help": "",
    "type": "text",
    "options": "",
    "group": 1,
    "flag": 0
  },
  {
    "key": "pagination_type",
    "value": "all",
    "help": "",
    "type": "select",
    "options": "all,pagination,load_more,auto_load_more",
    "group": 1,
    "flag": 0
  },
  {
    "key": "default_page_size",
    "value": "30",
    "help": "",
    "type": "number",
    "options": "",
    "group": 1,
    "flag": 0
  },
  {
    "key": "allow_indexed",
    "value": "false",
    "help": "",
    "type": "bool",
    "options": "",
    "group": 1,
    "flag": 0
  },
  {
    "key": "allow_mounted",
    "value": "false",
    "help": "",
    "type": "bool",
    "options": "",
    "group": 1,
    "flag": 0
  },
  {
    "key": "robots_txt",
    "value": "User-agent: *\nAllow: /",
    "help": "",
    "type": "text",
    "options": "",
    "group": 1,
    "flag": 0
  }
]
```

### 请求参数

| 名称          | 位置   | 类型          | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------------- | ---- | ------ | ---- |
| Authorization | header | string        | 是   |        | none |
| body          | body   | array[object] | 否   | 数组   | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

## POST 删除设置

POST /api/admin/setting/delete

仅用于弃用的设置

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| key           | query  | string | 是   |        | none |
| Authorization | header | string | 是   |        | none |

### 返回示例

> 200 Response

```json
{}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

## POST 重置令牌

POST /api/admin/setting/reset_token

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 否   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": "alist-9d"
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | string  | true | none | 新令牌 | none |

## POST 设置aria2

POST /api/admin/setting/set_aria2

> Body 请求参数

```json
{
  "uri": "string",
  "secret": "string"
}
```

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名    | 说明 |
| ------------- | ------ | ------ | ---- | --------- | ---- |
| Authorization | header | string | 是   |           | none |
| body          | body   | object | 否   |           | none |
| » uri         | body   | string | 是   | aria2地址 | none |
| » secret      | body   | string | 是   | aria2密钥 | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": "1.36.0"
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名    | 说明 |
| --------- | ------- | ---- | ---- | --------- | ---- |
| » code    | integer | true | none | 状态码    | none |
| » message | string  | true | none | 信息      | none |
| » data    | string  | true | none | aria2版本 | none |

## POST 设置qBittorrent

POST /api/admin/setting/set_qbit

> Body 请求参数

```json
{
  "url": "string",
  "seedtime": "string"
}
```

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名          | 说明 |
| ------------- | ------ | ------ | ---- | --------------- | ---- |
| Authorization | header | string | 是   |                 | none |
| body          | body   | object | 否   |                 | none |
| » url         | body   | string | 是   | qBittorrent链接 | none |
| » seedtime    | body   | string | 是   | 做种时间        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": "1.36.0"
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | string  | true | none |        | none |

---

## File: docs/guide/api/admin/storage.md

---
# This is the icon of the page
icon: iconfont icon-folder
# This control sidebar order
order: 4
# A page can have multiple categories
category:
  - Guide
# A page can have multiple tags
tag:
  - ADMIN
  - API
  - Guide
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---

# storage

## GET 列出存储列表

GET /api/admin/storage/list

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明     |
| ------------- | ------ | ------ | ---- | -------- |
| page          | query  | string | 否   | 页数     |
| per_page      | query  | string | 否   | 每页数目 |
| Authorization | header | string | 是   | token    |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "id": 1,
        "mount_path": "/lll",
        "order": 0,
        "driver": "Local",
        "cache_expiration": 0,
        "status": "work",
        "addition": "{\"root_folder_path\":\"/root/www\",\"thumbnail\":false,\"thumb_cache_folder\":\"\",\"show_hidden\":true,\"mkdir_perm\":\"777\"}",
        "remark": "",
        "modified": "2023-07-19T09:46:38.868739912+08:00",
        "disabled": false,
        "enable_sign": false,
        "order_by": "name",
        "order_direction": "asc",
        "extract_folder": "front",
        "web_proxy": false,
        "webdav_policy": "native_proxy",
        "down_proxy_url": ""
      }
    ],
    "total": 1
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称                 | 类型     | 必选  | 约束 | 中文名       | 说明         |
| -------------------- | -------- | ----- | ---- | ------------ | ------------ |
| » code               | integer  | true  | none | 状态码       | 状态码       |
| » message            | string   | true  | none | 信息         | 信息         |
| » data               | object   | true  | none |              | none         |
| »» content           | [object] | true  | none |              | none         |
| »»» id               | integer  | false | none | id           | id           |
| »»» mount_path       | string   | false | none | 挂载路径     | 挂载路径     |
| »»» order            | integer  | false | none | 排序         | 顺序         |
| »»» driver           | string   | false | none | 驱动         | 驱动类型     |
| »»» cache_expiration | integer  | false | none | 缓存过期时间 | 缓存时间     |
| »»» status           | string   | false | none | 状态         | 状态         |
| »»» addition         | string   | false | none | 额外信息     | 额外信息     |
| »»» remark           | string   | false | none | 备注         | 备注名       |
| »»» modified         | string   | false | none | 修改时间     | 修改时间     |
| »»» disabled         | boolean  | false | none | 禁用         | 是否被禁用   |
| »»» enable_sign      | boolean  | false | none | 启用签名     | none         |
| »»» order_by         | string   | false | none | 排序         | 排序方式     |
| »»» order_direction  | string   | false | none | 排序方向     | 排序方向     |
| »»» extract_folder   | string   | false | none | 提取文件夹   | 提取目录顺序 |
| »»» web_proxy        | boolean  | false | none | web代理      | http代理     |
| »»» webdav_policy    | string   | false | none | webdav代理   | webdav策略   |
| »»» down_proxy_url   | string   | false | none | 下载代理url  | 下载代理url  |
| »» total             | integer  | true  | none | 总数         | none         |

## POST 启用存储

POST /api/admin/storage/enable

### 请求参数

| 名称          | 位置   | 类型    | 必选 | 说明   |
| ------------- | ------ | ------- | ---- | ------ |
| id            | query  | integer | 是   | 存储id |
| Authorization | header | string  | 是   | token  |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明   |
| --------- | ------- | ---- | ---- | ------ | ------ |
| » code    | integer | true | none | 状态码 | 状态码 |
| » message | string  | true | none | 信息   | 信息   |
| » data    | null    | true | none | data   | data   |

## POST 禁用存储

POST /api/admin/storage/disable

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明   |
| ------------- | ------ | ------ | ---- | ------ |
| id            | query  | string | 是   | 存储id |
| Authorization | header | string | 是   | token  |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明   |
| --------- | ------- | ---- | ---- | ------ | ------ |
| » code    | integer | true | none | 状态码 | 状态码 |
| » message | string  | true | none | 信息   | 信息   |
| » data    | null    | true | none | data   | data   |

## POST 创建存储

POST /api/admin/storage/create

> Body 请求参数

```json
{
  "mount_path": "/lll",
  "order": 0,
  "remark": "",
  "cache_expiration": 30,
  "web_proxy": false,
  "webdav_policy": "native_proxy",
  "down_proxy_url": "",
  "extract_folder": "front",
  "enable_sign": false,
  "driver": "Local",
  "order_by": "name",
  "order_direction": "asc",
  "addition": "{\"root_folder_path\":\"/\",\"thumbnail\":false,\"thumb_cache_folder\":\"\",\"show_hidden\":true,\"mkdir_perm\":\"777\"}"
}
```

### 请求参数

| 名称               | 位置   | 类型    | 必选 | 中文名       | 说明  |
| ------------------ | ------ | ------- | ---- | ------------ | ----- |
| Authorization      | header | string  | 是   |              | token |
| body               | body   | object  | 否   |              | none  |
| » id               | body   | string  | 否   | ID           | none  |
| » mount_path       | body   | string  | 是   | 挂载路径     | none  |
| » order            | body   | integer | 否   | 排序         | none  |
| » driver           | body   | string  | 是   | 驱动         | none  |
| » remark           | body   | string  | 否   | 备注名       | none  |
| » cache_expiration | body   | integer | 否   | 缓存过期时间 | none  |
| » status           | body   | string  | 是   |              | none  |
| » web_proxy        | body   | boolean | 是   | web代理      | none  |
| » webdav_policy    | body   | string  | 否   | webdav策略   | none  |
| » down_proxy_url   | body   | string  | 否   | 下载代理     | none  |
| » order_by         | body   | string  | 是   | 排序方式     | none  |
| » extract_folder   | body   | string  | 是   | 提取目录     | none  |
| » order_direction  | body   | string  | 是   | 排序方向     | none  |
| » addition         | body   | string  | 是   | 额外信息     | none  |
| » enable_sign      | body   | string  | 是   | 启用签名     | none  |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "id": 7
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明   |
| --------- | ------- | ---- | ---- | ------ | ------ |
| » code    | integer | true | none | 状态码 | 状态码 |
| » message | string  | true | none | 信息   | 信息   |
| » data    | object  | true | none | data   | data   |
| »» id     | integer | true | none |        | none   |

## POST 更新存储

POST /api/admin/storage/update

> Body 请求参数

```json
{
  "mount_path": "/lll",
  "order": 0,
  "remark": "",
  "cache_expiration": 30,
  "web_proxy": false,
  "webdav_policy": "native_proxy",
  "down_proxy_url": "",
  "extract_folder": "front",
  "enable_sign": false,
  "driver": "Local",
  "order_by": "name",
  "order_direction": "asc",
  "addition": "{\"root_folder_path\":\"/\",\"thumbnail\":false,\"thumb_cache_folder\":\"\",\"show_hidden\":true,\"mkdir_perm\":\"777\"}"
}
```

### 请求参数

| 名称               | 位置   | 类型    | 必选 | 中文名       | 说明  |
| ------------------ | ------ | ------- | ---- | ------------ | ----- |
| Authorization      | header | string  | 是   |              | token |
| body               | body   | object  | 否   |              | none  |
| » id               | body   | string  | 否   | ID           | none  |
| » mount_path       | body   | string  | 是   | 挂载路径     | none  |
| » order            | body   | integer | 否   | 排序         | none  |
| » driver           | body   | string  | 是   | 驱动         | none  |
| » remark           | body   | string  | 否   | 备注名       | none  |
| » cache_expiration | body   | integer | 否   | 缓存过期时间 | none  |
| » status           | body   | string  | 是   |              | none  |
| » web_proxy        | body   | boolean | 是   | web代理      | none  |
| » webdav_policy    | body   | string  | 否   | webdav策略   | none  |
| » down_proxy_url   | body   | string  | 否   | 下载代理     | none  |
| » order_by         | body   | string  | 是   | 排序方式     | none  |
| » extract_folder   | body   | string  | 是   | 提取目录     | none  |
| » order_direction  | body   | string  | 是   | 排序方向     | none  |
| » addition         | body   | string  | 是   | 额外信息     | none  |
| » enable_sign      | body   | string  | 是   | 启用签名     | none  |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "id": 7
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明   |
| --------- | ------- | ---- | ---- | ------ | ------ |
| » code    | integer | true | none | 状态码 | 状态码 |
| » message | string  | true | none | 信息   | 信息   |
| » data    | object  | true | none | data   | data   |
| »» id     | integer | true | none |        | none   |

## GET 查询指定存储信息

GET /api/admin/storage/get

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明   |
| ------------- | ------ | ------ | ---- | ------ | ------ |
| id            | query  | string | 是   |        | 存储id |
| Authorization | header | string | 是   |        | token  |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "id": 2,
    "mount_path": "/aa",
    "order": 1,
    "driver": "Aliyundrive",
    "cache_expiration": 30,
    "status": "work",
    "addition": "{\"root_folder_id\":\"\",\"refresh_token\":\"\",\"order_by\":\"size\",\"order_direction\":\"ASC\",\"rapid_upload\":false}",
    "remark": "",
    "modified": "2022-11-26T21:50:44.142348853+08:00",
    "disabled": false,
    "order_by": "",
    "order_direction": "",
    "extract_folder": "front",
    "web_proxy": false,
    "webdav_policy": "302_redirect",
    "down_proxy_url": ""
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称                | 类型    | 必选 | 约束 | 中文名       | 说明 |
| ------------------- | ------- | ---- | ---- | ------------ | ---- |
| » code              | integer | true | none | 状态码       | none |
| » message           | string  | true | none | 信息         | none |
| » data              | object  | true | none |              | none |
| »» id               | integer | true | none | id           | none |
| »» mount_path       | string  | true | none | 挂载路径     | none |
| »» order            | integer | true | none | 排序         | none |
| »» driver           | string  | true | none | 驱动         | none |
| »» cache_expiration | integer | true | none | 缓存过期时间 | none |
| »» status           | string  | true | none | 状态         | none |
| »» addition         | string  | true | none | 额外信息     | none |
| »» remark           | string  | true | none | 备注         | none |
| »» modified         | string  | true | none | 修改时间     | none |
| »» disabled         | boolean | true | none | 是否被禁用   | none |
| »» order_by         | string  | true | none | 排序方式     | none |
| »» order_direction  | string  | true | none | 排序方向     | none |
| »» extract_folder   | string  | true | none | 提取目录     | none |
| »» web_proxy        | boolean | true | none | web代理      | none |
| »» webdav_policy    | string  | true | none | webdav策略   | none |
| »» down_proxy_url   | string  | true | none | 下载代理     | none |

## POST 删除指定存储

POST /api/admin/storage/delete

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明   |
| ------------- | ------ | ------ | ---- | ------ | ------ |
| id            | query  | string | 否   |        | 存储id |
| Authorization | header | string | 是   |        | token  |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明   |
| --------- | ------- | ---- | ---- | ------ | ------ |
| » code    | integer | true | none | 状态码 | 状态码 |
| » message | string  | true | none | 信息   | 信息   |
| » data    | null    | true | none | data   | data   |

## POST 重新加载所有存储

POST /api/admin/storage/load_all

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 是   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

---

## File: docs/guide/api/admin/task.md

---
# This is the icon of the page
icon: iconfont icon-file
# This control sidebar order
order: 6
# A page can have multiple categories
category:
  - Guide
# A page can have multiple tags
tag:
  - ADMIN
  - API
  - Guide
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: false
---

# task

本 API 现已移至`/api/task`，`/api/admin/task`仅出于兼容目的保留

另见[/api/task](/guide/api/task.html)

---

## File: docs/guide/api/admin/user.md

---
# This is the icon of the page
icon: iconfont icon-people
# This control sidebar order
order: 1
# A page can have multiple categories
category:
  - Guide
# A page can have multiple tags
tag:
  - ADMIN
  - API
  - Guide
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---

# user

## GET 列出所有用户

GET /api/admin/user/list

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明 |
| ------------- | ------ | ------ | ---- | ---- |
| Authorization | header | string | 是   | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "id": 1,
        "username": "admin",
        "password": "",
        "base_path": "/",
        "role": 2,
        "disabled": false,
        "permission": 0,
        "sso_id": ""
      },
      {
        "id": 2,
        "username": "guest",
        "password": "",
        "base_path": "/",
        "role": 1,
        "disabled": true,
        "permission": 0,
        "sso_id": ""
      },
      {
        "id": 3,
        "username": "N",
        "password": "",
        "base_path": "/",
        "role": 0,
        "disabled": false,
        "permission": 256,
        "sso_id": ""
      }
    ],
    "total": 3
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称           | 类型     | 必选 | 约束 | 中文名   | 说明 |
| -------------- | -------- | ---- | ---- | -------- | ---- |
| » code         | integer  | true | none | 状态码   | none |
| » message      | string   | true | none | 信息     | none |
| » data         | object   | true | none |          | none |
| »» content     | [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 |
| »» total       | integer  | true | none | 总数     | none |

## GET 列出某个用户

GET /api/admin/user/get

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 说明 |
| ------------- | ------ | ------ | ---- | ---- |
| id            | query  | string | 是   | none |
| Authorization | header | string | 是   | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "id": 1,
    "username": "admin",
    "password": "",
    "base_path": "/",
    "role": 2,
    "disabled": false,
    "permission": 0,
    "sso_id": ""
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | 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 |

## POST 新建用户

POST /api/admin/user/create

> Body 请求参数

```json
{
  "id": 0,
  "username": "a",
  "password": "123456",
  "base_path": "/",
  "role": 0,
  "permission": 60,
  "disabled": false,
  "sso_id": ""
}
```

### 请求参数

| 名称          | 位置   | 类型    | 必选 | 中文名   | 说明 |
| ------------- | ------ | ------- | ---- | -------- | ---- |
| Authorization | header | string  | 是   |          | none |
| body          | body   | object  | 否   |          | none |
| » id          | body   | integer | 否   | id       | none |
| » username    | body   | string  | 是   | 用户名   | none |
| » password    | body   | string  | 否   | 密码     | none |
| » base_path   | body   | string  | 否   | 基本路径 | none |
| » role        | body   | integer | 否   | 角色     | none |
| » permission  | body   | integer | 否   | 权限     | none |
| » disabled    | body   | boolean | 否   | 是否禁用 | none |
| » sso_id      | body   | string  | 否   | sso id   | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

## POST 更新用户信息

POST /api/admin/user/update

> Body 请求参数

```json
{
  "id": 0,
  "username": "a",
  "password": "123456",
  "base_path": "/",
  "role": 0,
  "permission": 60,
  "disabled": false,
  "sso_id": ""
}
```

### 请求参数

| 名称          | 位置   | 类型    | 必选 | 中文名   | 说明 |
| ------------- | ------ | ------- | ---- | -------- | ---- |
| Authorization | header | string  | 是   |          | none |
| body          | body   | object  | 否   |          | none |
| » id          | body   | integer | 是   | id       | none |
| » username    | body   | string  | 是   | 用户名   | none |
| » password    | body   | string  | 否   | 密码     | none |
| » base_path   | body   | string  | 否   | 基本路径 | none |
| » role        | body   | integer | 否   | 角色     | none |
| » permission  | body   | integer | 否   | 权限     | none |
| » disabled    | body   | boolean | 否   | 是否禁用 | none |
| » sso_id      | body   | string  | 否   | sso id   | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

## POST 取消某个用户的两步验证

POST /api/admin/user/cancel_2fa

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| id            | query  | string | 是   |        | none |
| Authorization | header | string | 是   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

## POST 删除用户

POST /api/admin/user/delete

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| id            | query  | string | 是   |        | none |
| Authorization | header | string | 否   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

## POST 删除用户缓存

POST /api/admin/user/del_cache

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| username      | query  | string | 是   |        | none |
| Authorization | header | string | 否   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

## GET 列出用户的 SFTP 公钥

GET /api/admin/user/sshkey/list

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 是   |        | none |
| uid           | query  | string | 是   | 用户id | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "id": 1,
        "title": "Test-SSH-Key",
        "fingerprint": "SHA256:aAFI5C******************************KD6hYhs",
        "added_time": "2024-12-15T20:09:28.1777368+08:00",
        "last_used_time": "2024-12-15T20:10:07.7846528+08:00"
      },
      {
        "id": 2,
        "title": "Test-SSH-Key-2",
        "fingerprint": "SHA256:P2zrSs******************************h0Q5BOQ",
        "added_time": "2024-12-20T20:09:28.1777368+08:00",
        "last_used_time": "2024-12-25T20:10:07.7846528+08:00"
      },
    ],
    "total": 2
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称          | 类型    | 必选 | 约束 | 中文名           | 说明 |
| ------------- | ------- | ---- | ---- | ---------------- | ---- |
| » code        | integer | true | none | 状态码           | none |
| » message     | string  | true | none | 信息             | none |
| » data        | object  | true | none | 数据             | none |
| »» content    | [object] | true | none |                | none |
| »»» id        | integer | true | none | 公钥主键          | none |
| »»» title     | string | true | none | 公钥名称        | none |
| »»» fingerprint | string | true | none | 公钥指纹        | none |
| »»» added_time | string | true | none | 添加时间        | none |
| »»» last_used_time | string | true | none | 上次认证时间  | none |
| »» total      | integer | true | none | 总数             | none |

## POST 删除用户的 SFTP 公钥

POST /api/admin/user/sshkey/delete

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 是   |        | none |
| id            | query  | integer | 是  | 公钥主键 | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

---

## File: docs/guide/api/apifox.md

---
# This is the icon of the page
icon: iconfont icon-setting
# This control sidebar order
order: 1
# A page can have multiple categories
category:
  - Guide
# A page can have multiple tags
tag:
  - API
  - Guide
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---

# online tool

Go to [https://openlist.apifox.cn](https://openlist.apifox.cn) and view the API documentation online. Debugging is supported.

---

## File: docs/guide/api/auth.md

---
# This is the icon of the page
icon: iconfont icon-token
# This control sidebar order
order: 2
# A page can have multiple categories
category:
  - Guide
# A page can have multiple tags
tag:
  - API
  - Guide
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---

# auth

## POST token获取

POST /api/auth/login

获取某个用户的临时JWt token, 有效期默认48小时

> Body 请求参数

```json
{
  "username": "{{alist_username}}",
  "password": "{{alist_password}}"
}
```

### 请求参数

| 名称       | 位置 | 类型   | 必选 | 中文名     | 说明       |
| ---------- | ---- | ------ | ---- | ---------- | ---------- |
| body       | body | object | 否   |            | none       |
| » username | body | string | 是   | 用户名     | 用户名     |
| » password | body | string | 是   | 密码       | 密码       |
| » otp_code | body | string | 否   | 二步验证码 | 二步验证码 |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "token": "abcd"
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明   |
| --------- | ------- | ---- | ---- | ------ | ------ |
| » code    | integer | true | none |        | 状态码 |
| » message | string  | true | none |        | 信息   |
| » data    | object  | true | none |        | data   |
| »» token  | string  | true | none |        | token  |

## POST token获取hash

POST /api/auth/login/hash

获取某个用户的临时JWt token，传入的密码需要在添加`-https://github.com/alist-org/alist`后缀后再进行sha256

> Body 请求参数

```json
{
  "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 | 否   | 二步验证码 | 二步验证码                                                              |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "token": "abcd"
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明   |
| --------- | ------- | ---- | ---- | ------ | ------ |
| » code    | integer | true | none |        | 状态码 |
| » message | string  | true | none |        | 信息   |
| » data    | object  | true | none |        | data   |
| »» token  | string  | true | none |        | token  |

## POST 生成2FA密钥

POST /api/auth/2fa/generate

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 是   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "qr": "data:image/png;base64,iVBORw0KGgoAAAANSUhE",
    "secret": "RPQZG4MDS3"
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | 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 验证2FA code

POST /api/auth/2fa/verify

> Body 请求参数

```json
{
  "code": "string",
  "secret": "string"
}
```

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名    | 说明 |
| ------------- | ------ | ------ | ---- | --------- | ---- |
| Authorization | header | string | 是   |           | none |
| body          | body   | object | 否   |           | none |
| » code        | body   | string | 是   | 2FA验证码 | none |
| » secret      | body   | string | 是   | 2FA密钥   | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称      | 类型    | 必选 | 约束 | 中文名 | 说明 |
| --------- | ------- | ---- | ---- | ------ | ---- |
| » code    | integer | true | none | 状态码 | none |
| » message | string  | true | none | 信息   | none |
| » data    | null    | true | none |        | none |

## GET 获取当前用户信息

GET /api/me

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 否   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "id": 1,
    "username": "admin",
    "password": "",
    "base_path": "/",
    "role": 2,
    "disabled": false,
    "permission": 0,
    "sso_id": "",
    "otp": true
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | 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 |

## GET 列出当前用户 SFTP 公钥

GET /api/me/sshkey/list

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 是   |        | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "id": 1,
        "title": "Test-SSH-Key",
        "fingerprint": "SHA256:aAFI5C******************************KD6hYhs",
        "added_time": "2024-12-15T20:09:28.1777368+08:00",
        "last_used_time": "2024-12-15T20:10:07.7846528+08:00"
      },
      {
        "id": 2,
        "title": "Test-SSH-Key-2",
        "fingerprint": "SHA256:P2zrSs******************************h0Q5BOQ",
        "added_time": "2024-12-20T20:09:28.1777368+08:00",
        "last_used_time": "2024-12-25T20:10:07.7846528+08:00"
      },
    ],
    "total": 2
  }
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称          | 类型    | 必选 | 约束 | 中文名           | 说明 |
| ------------- | ------- | ---- | ---- | ---------------- | ---- |
| » code        | integer | true | none | 状态码           | none |
| » message     | string  | true | none | 信息             | none |
| » data        | object  | true | none | 数据             | none |
| »» content    | [object] | true | none |                | none |
| »»» id        | integer | true | none | 公钥主键          | none |
| »»» title     | string | true | none | 公钥名称        | none |
| »»» fingerprint | string | true | none | 公钥指纹        | none |
| »»» added_time | string | true | none | 添加时间        | none |
| »»» last_used_time | string | true | none | 上次认证时间  | none |
| »» total      | integer | true | none | 总数             | none |

## POST 给当前用户添加 SFTP 公钥

POST /api/me/sshkey/add

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 是   |        | none |
| body          | body   | object | 否   |        | none |
| » title       | body   | string | 是   | 公钥名  | none |
| » key         | body   | string | 是   | 公钥内容 | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称          | 类型    | 必选 | 约束 | 中文名           | 说明 |
| ------------- | ------- | ---- | ---- | ---------------- | ---- |
| » code        | integer | true | none | 状态码           | none |
| » message     | string  | true | none | 信息             | none |
| » data        | null    | true | none |                 | none |

## POST 删除当前用户的 SFTP 公钥

POST /api/me/sshkey/delete

### 请求参数

| 名称          | 位置   | 类型   | 必选 | 中文名 | 说明 |
| ------------- | ------ | ------ | ---- | ------ | ---- |
| Authorization | header | string | 是   |        | none |
| id            | query  | integer | 是   | 公钥主键 | none |

### 返回示例

> 成功

```json
{
  "code": 200,
  "message": "success",
  "data": null
}
```

### 返回结果

| 状态码 | 状态码含义                                              | 说明 | 数据模型 |
| ------ | ------------------------------------------------------- | ---- | -------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | 成功 | Inline   |

### 返回数据结构

状态码 **200**

| 名称          | 类型    | 必选 | 约束 | 中文名           | 说明 |
| ------------- | ------- | ---- | ---- | ---------------- | ---- |
| » code        | integer | true | none | 状态码           | none |
| » message     | string  | true | none | 信息             | none |
| » data        | null    | true | none |                 | none |