mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-29 11:30:24 +08:00
使用请求ID搜索访问日志时自动去除多余的空格和句号
This commit is contained in:
@@ -330,9 +330,9 @@ func (this *HTTPAccessLogDAO) listAccessLogs(tx *dbs.Tx, lastRequestId string, s
|
|||||||
query.Param("intKeyword2", types.Int(pieces[1]))
|
query.Param("intKeyword2", types.Int(pieces[1]))
|
||||||
}
|
}
|
||||||
|
|
||||||
if regexp.MustCompile(`^\d{20,}$`).MatchString(keyword) {
|
if regexp.MustCompile(`^\d{20,}\s*\.?$`).MatchString(keyword) {
|
||||||
where += " OR requestId=:requestId"
|
where += " OR requestId=:requestId"
|
||||||
query.Param("requestId", keyword)
|
query.Param("requestId", strings.TrimRight(keyword, ". "))
|
||||||
}
|
}
|
||||||
|
|
||||||
query.Where("("+where+")").
|
query.Where("("+where+")").
|
||||||
|
|||||||
Reference in New Issue
Block a user