release: v1.4.0 — 标签系统、操作日志扩展与文档截图更新
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s

- 每用户标签与彩色打标,图库 OR/AND 筛选与批量打标
- 操作日志记录登录、删除、设置与标签操作
- API 标签/打标接口;README 与文档站截图同步
This commit is contained in:
O96u committed 2026-09-09 14:46:52 +08:00
1 parent f17d79b236
commit 737235acff
110 files changed
+5881 -778

No files matched your search

+29 -1
View File
@@ -2,6 +2,8 @@
PicHost exposes REST endpoints and a Twikoo-compatible upload. After sign-in, open **API** in the nav: a sidebar lists endpoints and token controls, the center shows parameters and copyable cURL, and the right panel supports **live debugging**.
![API docs and debugger](/screenshots/api.png)
## Authentication
All REST calls use:
@@ -28,9 +30,12 @@ Upload one or more images via `image`; also accepts `file`, `files`. Stored unde
```bash
curl -X POST "https://admin.example.com/api/images/upload" \
-H "Auth-Token: YOUR_TOKEN" \
-F "image=@./demo.png"
-F "image=@./demo.png" \
-F 'tagIds=[1,2]'
```
Optional form field `tagIds`: JSON array string or repeated fields. Tags do **not** change storage paths under `images/`.
### 2. List images
`GET /api/images`
@@ -42,6 +47,8 @@ curl "https://admin.example.com/api/images?limit=20&page=1" \
-H "Auth-Token: YOUR_TOKEN"
```
Optional query: `tagIds` (comma-separated, OR by default), `tagMode=and`, `untagged=1`. Each item includes a `tags` array.
### 3. Search images
`GET /api/images/search`
@@ -77,6 +84,27 @@ curl -X POST "https://admin.example.com/api/images/batch-delete" \
-d '{"keys":["images/2026/08/a.webp","images/2026/08/b.webp"]}'
```
### 6. Tags
| Method | Path | Description |
| ------ | ---- | ----------- |
| `GET` | `/api/tags` | List current user’s tags |
| `POST` | `/api/tags` | Create `{ "name": "work", "color": "#22c55e" }` |
| `PATCH` | `/api/tags/:id` | Rename or recolor |
| `DELETE` | `/api/tags/:id` | Delete tag (images remain) |
| `POST` | `/api/tags/merge` | Merge tags into a target |
### 7. Image tags
| Method | Path | Description |
| ------ | ---- | ----------- |
| `POST` | `/api/images/tags` | Add tags to an image |
| `PATCH` | `/api/images/tags` | Replace tag set |
| `DELETE` | `/api/images/tags` | Remove one tag |
| `POST` | `/api/images/batch-tags` | Batch add/remove |
`GET /api/stats` accepts the same tag filter query params as the list API.
## Errors
REST responses are JSON with `code` and `message` (`UNAUTHORIZED`, `FORBIDDEN`, `INVALID_REQUEST`, etc.). Twikoo uses EasyImage-compatible JSON.