getData
查询面板 SQLite 数据库中的任意表,支持搜索、分页、排序。这是获取各类资源 ID 的核心接口。
- 路由:
POST /data - action:
getData
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 getData |
| table | 是 | String | 表名:sites、databases、ftps、domain、crontab、backup、config |
| type | 否 | String | 筛选类型,-1 表示全部 |
| search | 否 | String | 搜索关键词 |
| p | 否 | Integer | 页码 |
| limit | 否 | Integer | 每页数量 |
| list | 否 | String | true 返回数组格式 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| data | Array | 数据记录列表 |
| page | String | 分页 HTML |
| where | String | 查询条件 |
常用示例
查网站列表
action=getData&table=sites&type=-1
{"data": [{"id": 1, "name": "testapi.bt.local", "path": "/www/wwwroot/testapi.bt.local", "status": "1"}]}
查数据库列表
action=getData&table=databases&type=-1
查FTP用户列表
action=getData&table=ftps&type=-1
查域名列表
action=getData&table=domain&search=1&list=true