mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-11 04:50:25 +08:00
使用IPv6的IP搜索访问日志时自动去掉[]
This commit is contained in:
@@ -417,6 +417,9 @@ func (this *HTTPAccessLogDAO) listAccessLogs(tx *dbs.Tx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 去掉IPv6的[]
|
||||||
|
ip = strings.Trim(ip, "[]")
|
||||||
|
|
||||||
query.Attr("remoteAddr", ip)
|
query.Attr("remoteAddr", ip)
|
||||||
query.UseIndex("remoteAddr")
|
query.UseIndex("remoteAddr")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user