Version: 0.2.3.dev.260211

fix: 🐛 修复刷新 Token 接口错误返回问题

- 当 token 本身存在问题时,改为返回 400 业务错误
- 不再错误地返回 500 服务端异常状态码 

feat: 🔁 新增基于 X-Idempotency-Key 与 Redis 的通用幂等中间件

- 基于 X-Idempotency-Key 实现请求幂等控制 🧩
- 记录 UUID 及对应返回结果至 Redis
- 当相同 UUID 重复请求时,直接返回缓存结果 
- 应用于所有涉及增删改操作的接口
- 解决部分接口未实现幂等性的问题 🔒
This commit is contained in:
LoveLosita
2026-02-11 16:16:07 +08:00
parent 0bc06963ee
commit cf9a3c79e4
5 changed files with 149 additions and 19 deletions

View File

@@ -240,4 +240,14 @@ var ( //请求相关的响应
Status: "40036",
Info: "task class item not found",
}
MissingIdempotencyKey = Response{ //缺少幂等性键
Status: "40037",
Info: "missing idempotency key",
}
RequestIsProcessing = Response{ //请求正在处理中
Status: "40038",
Info: "request is processing, please do not repeat click",
}
)