管理接口
所有管理接口需要在 Header 带 JWT Token。
登录
POST /api/auth/login
bash
curl -X POST https://api.techconsult.site/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"your_password"}'响应
json
{
"success": true,
"token": "eyJhbGciOiJIUzI1NiIs..."
}Token 有效期 7 天,存 localStorage,后台 pk-order-admin 自动管理。
使用 Token
bash
curl https://api.techconsult.site/api/orders \
-H "Authorization: Bearer <token>"GET /api/orders
订单列表,支持按 domain、status、from、to、page、pageSize 过滤。
bash
curl "https://api.techconsult.site/api/orders?domain=techconsult.site&page=1&pageSize=20" \
-H "Authorization: Bearer <token>"GET /api/orders/detail/:orderNo
按订单号查询详情,管理员接口不受当前请求域名限制。
bash
curl https://api.techconsult.site/api/orders/detail/MO2RC2QC-V2G \
-H "Authorization: Bearer <token>"PATCH /api/orders/:id/status
更新订单状态。
bash
curl -X PATCH https://api.techconsult.site/api/orders/69e2096fb89a14295f5964fa/status \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"status":"paid"}'可选 status | 说明 |
|---|---|
pending | 待支付 |
paid | 已支付 |
cancelled | 已取消 |
GET /api/admin/events
管理后台订单事件流,使用 query token 鉴权,返回 text/event-stream。
bash
curl "https://api.techconsult.site/api/admin/events?domain=techconsult.site&token=<token>"后台管理入口
不建议直接调接口,使用 pk-order-admin:
| 域名 | 后台地址 |
|---|---|
| techconsult.site | admin.techconsult.site |
| technologyconsult.org | admin.technologyconsult.org |