feat(api): 新增 API Key Web 管理后台(使用者/备注/限流/配额/有效期/启停/删除),管理接口与普通 Key 隔离

This commit is contained in:
sgp
2026-11-04 18:26:39 +08:00
parent a14670e65a
commit ca75da8589
5 changed files with 811 additions and 12 deletions
+11
View File
@@ -282,6 +282,17 @@ sudo systemctl restart drawlogo-api
### Key 管理
**Web 管理后台**(推荐):`https://drawlogo.zhuig.com/api-admin.html`
- 输入管理口令进入(口令 = 服务器 `config.json` 的 `adminToken`)
- 可视化签发 Key:填写**使用者**、**备注**、**每分钟限流**、**每日配额**、**有效期**
- 列表可查看今日用量、最近使用时间,支持**启用/禁用/编辑/删除**
- 明文 Key 只在签发时显示一次,页面提供一键复制
> 管理口令与普通 API Key 完全分离;普通 Key 无法访问管理接口。口令为空时后台接口整体关闭。
**命令行**(服务器 `/opt/drawlogo-api`):
```bash
cd /opt/drawlogo-api
node admin.js create --name "项目A" --rate 120 --quota 30000