mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-13 15:30:24 +08:00
实现WAF通知和记录IP功能
This commit is contained in:
@@ -233,6 +233,12 @@ func (this *HTTPAccessLogDAO) listAccessLogs(tx *dbs.Tx, lastRequestId string, s
|
||||
|
||||
where := "JSON_EXTRACT(content, '$.remoteAddr') LIKE :keyword OR JSON_EXTRACT(content, '$.requestURI') LIKE :keyword OR JSON_EXTRACT(content, '$.host') LIKE :keyword"
|
||||
|
||||
jsonKeyword, err := json.Marshal(keyword)
|
||||
if err == nil {
|
||||
where += " OR JSON_CONTAINS(content, :jsonKeyword, '$.tags')"
|
||||
query.Param("jsonKeyword", jsonKeyword)
|
||||
}
|
||||
|
||||
// 请求方法
|
||||
if keyword == http.MethodGet ||
|
||||
keyword == http.MethodPost ||
|
||||
|
||||
Reference in New Issue
Block a user