|
|
@@ -33,6 +33,10 @@ func Limiter(c *gin.Context) { |
|
|
|
//body, _ := ioutil.ReadAll(c.Request.Body) |
|
|
|
// Write body back |
|
|
|
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()) //不建议开启,失去限流的意义 |
|
|
|
|
|
|
|
//TODO::分布式锁阻拦(保证原子性) |
|
|
|