Skip to main content

setting

Andy HsuGuideADMINAPIGuideAbout 4 min

setting

GET 列出设置

GET /api/admin/setting/list

包括永久令牌

请求参数

名称位置类型必选说明
groupsquerystring5,0-其它设置,包括aria2和令牌等
groupquerystring1-站点;2-样式;3-预览;4-全局;7-单点登录
Authorizationheaderstringnone

返回示例

成功

{
  "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
    }
  ]
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» data[object]truenonenone
»» keystringtruenonenone
»» valuestringtruenonenone
»» helpstringtruenone帮助信息none
»» typestringtruenone类型string, number, bool, select
»» optionsstringtruenone选项none
»» groupintegertruenone分组用于前端分组
»» flagintegertruenone标志0 = public, 1 = private, 2 = readonly, 3 = deprecated

GET 获取某项设置

GET /api/admin/setting/get

请求参数

名称位置类型必选说明
keysquerystringnone
keyquerystringnone
Authorizationheaderstringnone

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» dataobjecttruenonenone
»» keystringtruenonenone
»» valuestringtruenonenone
»» helpstringtruenone帮助信息none
»» typestringtruenone类型string, number, bool, select
»» optionsstringtruenone选项none
»» groupintegertruenone分组none
»» flagintegertruenone标志0 = public, 1 = private, 2 = readonly, 3 = deprecated

POST 保存设置

POST /api/admin/setting/save

Body 请求参数

[
  {
    "key": "version",
    "value": "v3.25.1",
    "help": "",
    "type": "string",
    "options": "",
    "group": 1,
    "flag": 2
  },
  {
    "key": "site_title",
    "value": "AList",
    "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
  }
]

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyarray[object]数组none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone

POST 删除设置

POST /api/admin/setting/delete

仅用于弃用的设置

请求参数

名称位置类型必选中文名说明
keyquerystringnone
Authorizationheaderstringnone

返回示例

200 Response

{}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

POST 重置令牌

POST /api/admin/setting/reset_token

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datastringtruenone新令牌none

POST 设置aria2

POST /api/admin/setting/set_aria2

Body 请求参数

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

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» uribodystringaria2地址none
» secretbodystringaria2密钥none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datastringtruenonearia2版本none

POST 设置qBittorrent

POST /api/admin/setting/set_qbit

Body 请求参数

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

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone
bodybodyobjectnone
» urlbodystringqBittorrent链接none
» seedtimebodystring做种时间none

返回示例

成功

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

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datastringtruenonenone