refactor🎨: 操作log添加字符限制

This commit is contained in:
zhangwenjian committed 2021-07-04 23:13:14 +08:00
1 parent c1347fbb5d
commit 3f90605589
3 files changed
+14 -10

No files matched your search

+4
View File
@@ -74,6 +74,10 @@ func SaveOperaLog(message storage.Messager) (err error) {
// Log writing to the database ignores error
return nil
}
// 超出100个字符返回值截断
if len(l.JsonResult) > 100 {
l.JsonResult = l.JsonResult[:100]
}
err = db.Create(&l).Error
if err != nil {
log.Errorf("db create error, %s", err.Error())