docs: 将Token有效期从24小时更新为48小时

更新所有相关API文档及登录接口实现,将Token有效期从24小时延长至48小时,以改善管理员用户体验。
This commit is contained in:
anghunk
2026-01-29 13:51:58 +08:00
parent 47a64e29eb
commit f886ede9db
4 changed files with 5 additions and 5 deletions

View File

@@ -46,14 +46,14 @@ export const adminLogin = async (c: Context<{ Bindings: Bindings }>) => {
// 生成 Token (你的 tempKey)
const tempKey = crypto.randomUUID();
// 将 Token 存入 KV有效期 24 小时(86400秒
// 将 Token 存入 KV有效期 48 小时(172800秒
await c.env.CWD_AUTH_KV.put(
`token:${tempKey}`,
JSON.stringify({
user: data.name,
ip: ip,
}),
{ expirationTtl: 86400 }
{ expirationTtl: 172800 }
);
return c.json({

View File

@@ -8,7 +8,7 @@
Authorization: Bearer <token>
```
Token 通过登录接口获取,有效期为 24 小时。
Token 通过登录接口获取,有效期为 48 小时。
## 接口分类

View File

@@ -8,7 +8,7 @@
Authorization: Bearer <token>
```
Token 通过登录接口获取,有效期为 24 小时。
Token 通过登录接口获取,有效期为 48 小时。
## 1.1 管理员登录

View File

@@ -49,7 +49,7 @@ CWD 评论部署成功,当前版本...
Authorization: Bearer <token>
```
Token 通过登录接口获取,有效期为 24 小时,服务端会在 KV 中存储会话信息并在每次请求时进行校验。
Token 通过登录接口获取,有效期为 48 小时,服务端会在 KV 中存储会话信息并在每次请求时进行校验。
## HTTP 状态码