We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a92792 commit b2796adCopy full SHA for b2796ad
server/middleware/email.go
@@ -1,6 +1,7 @@
1
package middleware
2
3
import (
4
+ "bytes"
5
"io/ioutil"
6
"strconv"
7
"time"
@@ -32,6 +33,8 @@ func ErrorToEmail() gin.HandlerFunc {
32
33
username = user.Username
34
}
35
body, _ := ioutil.ReadAll(c.Request.Body)
36
+ // 再重新写回请求体body中,ioutil.ReadAll会清空c.Request.Body中的数据
37
+ c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body))
38
record := system.SysOperationRecord{
39
Ip: c.ClientIP(),
40
Method: c.Request.Method,
0 commit comments