|
@@ -143,10 +143,9 @@ func (c *BaseAuthController) ServeJSON(encoding ...bool) {
|
|
|
hasEncoding = true
|
|
|
}
|
|
|
if c.Data["json"] == nil {
|
|
|
- //go utils.SendEmail("异常提醒:", "接口:"+"URI:"+c.Ctx.Input.URI()+";无返回值", utils.EmailSendToUsers)
|
|
|
body := "接口:" + "URI:" + c.Ctx.Input.URI() + ";无返回值"
|
|
|
fmt.Println(body)
|
|
|
- // go alarm_msg.SendAlarmMsg(body, 1)
|
|
|
+ utils.ApiLog.Notice(body)
|
|
|
return
|
|
|
}
|
|
|
baseRes := c.Data["json"].(*models.BaseResponse)
|
|
@@ -160,14 +159,12 @@ func (c *BaseAuthController) ServeJSON(encoding ...bool) {
|
|
|
//requestBody, _ = url.QueryUnescape(string(c.Ctx.Input.RequestBody))
|
|
|
requestBody = string(c.Ctx.Input.RequestBody)
|
|
|
}
|
|
|
- if baseRes.Ret != 200 && baseRes.IsSendEmail {
|
|
|
- //go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "URI:"+c.Ctx.Input.URI()+"<br/> "+"Params"+requestBody+" <br/>"+"ErrMsg:"+baseRes.ErrMsg+";<br/>Msg:"+baseRes.Msg+";<br/> Body:"+string(body)+"<br/>"+c.SysUser.RealName, utils.EmailSendToUsers)
|
|
|
+ if baseRes.Ret != 200 {
|
|
|
body := "URI:" + c.Ctx.Input.URI() + "<br/> " + "Params" + requestBody + " <br/>" + "ErrMsg:" + baseRes.ErrMsg + ";<br/>Msg:" + baseRes.Msg + ";<br/> Body:" + string(body) + "<br/>" + c.SysUser.SysRealName
|
|
|
- // go alarm_msg.SendAlarmMsg(body, 1)
|
|
|
fmt.Println(body)
|
|
|
+ utils.ApiLog.Notice(body)
|
|
|
}
|
|
|
if baseRes.IsAddLog && c.SysUser != nil {
|
|
|
- // go cache.RecordNewLogs(c.SysUser.AdminId, requestBody, string(body), c.SysUser.RealName, c.Ctx.Input.IP(), c.Ctx.Input.URI())
|
|
|
return
|
|
|
}
|
|
|
}
|