Browse Source

update

tmp
dengbiao 3 weeks ago
parent
commit
d2838f5f50
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      app/mw/mw_limiter.go

+ 4
- 0
app/mw/mw_limiter.go View File

@@ -33,6 +33,10 @@ func Limiter(c *gin.Context) {
//body, _ := ioutil.ReadAll(c.Request.Body) //body, _ := ioutil.ReadAll(c.Request.Body)
// Write body back // Write body back
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body)) c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body))
utils.FilePutContents("Limiter", utils.SerializeStr(map[string]interface{}{
"uri": c.Request.URL,
"body": c.Request.Body,
}))
//queryValue := utils.SerializeStr(c.Request.URL.Query()) //不建议开启,失去限流的意义 //queryValue := utils.SerializeStr(c.Request.URL.Query()) //不建议开启,失去限流的意义


//TODO::分布式锁阻拦(保证原子性) //TODO::分布式锁阻拦(保证原子性)


Loading…
Cancel
Save