提交 827a565a 编写于 作者: Sliver_Horn's avatar Sliver_Horn

修复文件上传记录body太大导致的数据库报错

上级 88ba3440
......@@ -11,6 +11,7 @@ import (
"io/ioutil"
"net/http"
"strconv"
"strings"
"time"
)
......@@ -45,6 +46,10 @@ func OperationRecord() gin.HandlerFunc {
Body: string(body),
UserID: userId,
}
values := c.Request.Header.Values("content-type")
if strings.Contains(values[0], "boundary"){
record.Body = "file"
}
writer := responseBodyWriter{
ResponseWriter: c.Writer,
body: &bytes.Buffer{},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册