优化结构
This commit is contained in:
@@ -22,7 +22,9 @@ func ErrorAudit(logger *slog.Logger) gin.HandlerFunc {
|
||||
// already recorded by the handler with the underlying filesystem error;
|
||||
// emitting again from the response envelope would duplicate both the
|
||||
// classified error file and the sys_error row.
|
||||
if auditPersistFailed != true && (strings.Contains(c.Request.URL.Path, "/sysError/") || strings.Contains(c.Request.URL.Path, "/logViewer/") || c.Writer.Status() >= 300 && c.Writer.Status() < 500) {
|
||||
isSelfAudit := strings.Contains(c.Request.URL.Path, "/sysError/") || strings.Contains(c.Request.URL.Path, "/logViewer/")
|
||||
isClientFailure := c.Writer.Status() >= 300 && c.Writer.Status() < 500
|
||||
if auditPersistFailed != true && (isSelfAudit || isClientFailure) {
|
||||
return
|
||||
}
|
||||
var response httpx.Response
|
||||
|
||||
Reference in New Issue
Block a user