增加表格导入,增加导入模板下载,修复日志中间件的截断bug。

This commit is contained in:
piexlMax
2024-01-05 23:09:07 +08:00
parent ad41b7b434
commit 1a04bb535d
9 changed files with 228 additions and 19 deletions
+2 -9
View File
@@ -78,11 +78,7 @@ func OperationRecord() gin.HandlerFunc {
// 上传文件时候 中间件日志进行裁断操作
if strings.Contains(c.GetHeader("Content-Type"), "multipart/form-data") {
if len(record.Body) > bufferSize {
// 截断
newBody := respPool.Get().([]byte)
copy(newBody, record.Body)
record.Body = string(newBody)
defer respPool.Put(newBody)
record.Body = "[文件]"
}
}
@@ -112,10 +108,7 @@ func OperationRecord() gin.HandlerFunc {
strings.Contains(c.Writer.Header().Get("Content-Transfer-Encoding"), "binary") {
if len(record.Resp) > bufferSize {
// 截断
newBody := respPool.Get().([]byte)
copy(newBody, record.Resp)
record.Resp = string(newBody)
defer respPool.Put(newBody)
record.Body = "超出记录长度"
}
}