Browse Source

修改ErrorToEmail中间件的请求方式错误

main
SliverHorn 4 years ago
parent
commit
ab4fa15fd6
  1. 2
      server/middleware/email.go

2
server/middleware/email.go

@ -42,7 +42,7 @@ func ErrorToEmail() gin.HandlerFunc {
latency := time.Now().Sub(now)
status := c.Writer.Status()
record.ErrorMessage = c.Errors.ByType(gin.ErrorTypePrivate).String()
str := "接收到的请求为" + record.Body + "\n" + "请求方式为" + record.Path + "\n" + "报错信息如下" + record.ErrorMessage + "\n" + "耗时" + latency.String() + "\n"
str := "接收到的请求为" + record.Body + "\n" + "请求方式为" + record.Method + "\n" + "报错信息如下" + record.ErrorMessage + "\n" + "耗时" + latency.String() + "\n"
if global.GVA_CONFIG.System.ErrorToEmail {
if status != 200 {
subject := username + "" +record.Ip + "调用了" + record.Path + "报错了"

Loading…
Cancel
Save