Merge pull request #160 from hailaz/v2.0

fix: 修复日志记录时明文显示密码的问题
This commit is contained in:
孟帅 2025-01-09 18:38:07 +08:00 committed by GitHub
commit 5301bedff2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -206,6 +206,13 @@ func (s *sSysLog) AnalysisLog(ctx context.Context) entity.SysLog {
if postData.IsNil() || len(postData.Map()) == 0 {
postData = gjson.New(consts.NilJsonToString)
} else {
// 隐藏明文显示的密码
for k := range postData.Map() {
if gstr.ContainsI(k, "password") {
postData.MustSet(k, "******")
}
}
}
// 当前登录用户