feat(login): 添加 IP 限速机制以防止频繁登录尝试

- 在登录功能中实现同一 IP 1 分钟内最多尝试 10 次的限制
- 记录登录时间戳并过滤过期记录,确保登录尝试次数的准确性
- 优化未登录用户的返回信息,避免泄露敏感数据
This commit is contained in:
2026-03-31 00:10:39 +08:00
parent 37a67f5810
commit b3f263c965
2 changed files with 35 additions and 9 deletions
+3
View File
@@ -744,6 +744,9 @@ func setMakeCodeListener(name string, appIns *Application) {
}
}
if context.RouterString[0] != name {
return isFinished
}
if len(context.RouterString) < 2 || len(context.RouterString) > 3 ||
!(context.Router[context.RouterString[0]] != nil &&
context.Router[context.RouterString[0]][context.RouterString[1]] != nil) {