Browse Source

update

tmp
dengbiao 6 days ago
parent
commit
95cffe3291
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/mw/mw_limiter.go

+ 5
- 1
app/mw/mw_limiter.go View File

@@ -15,7 +15,11 @@ import (
func Limiter(c *gin.Context) {
limit := 500 // 限流次数
ttl := 2 // 限流过期时间
ip := c.ClientIP()
ip := utils.GetIP(c.Request)
if ip != "221.4.210.167" {
e.OutErr(c, e.ERR, "系统维护中~")
return
}
// 读取token或者ip
token := c.GetHeader("Authorization")
// 判断是否已经超出限额次数


Loading…
Cancel
Save