调整日志输出方式,更新数据库日志存储结构;首页查询统计数据接口实现
This commit is contained in:
20
web/web.go
20
web/web.go
@@ -150,17 +150,15 @@ func newLogger() fiber.Handler {
|
||||
var errStr = strings.TrimSpace(logVars[5])
|
||||
|
||||
var item = &m.LogsRequest{
|
||||
IP: ip,
|
||||
Ua: u.P(ua),
|
||||
Method: method,
|
||||
Path: path,
|
||||
Latency: &latency,
|
||||
Status: int32(status),
|
||||
Error: &errStr,
|
||||
Time: u.P(orm.LocalDateTime(reqTime)),
|
||||
}
|
||||
if authType != auth.PayloadNone {
|
||||
item.Identity = u.P(int32(authType))
|
||||
Identity: int32(authType),
|
||||
IP: ip,
|
||||
Ua: u.P(ua),
|
||||
Method: method,
|
||||
Path: path,
|
||||
Latency: latency,
|
||||
Status: int32(status),
|
||||
Error: &errStr,
|
||||
Time: orm.LocalDateTime(reqTime),
|
||||
}
|
||||
if authID != 0 {
|
||||
item.Visitor = u.P(int32(authID))
|
||||
|
||||
Reference in New Issue
Block a user