Skip to content

Commit

Permalink
fix: checkSensitiveImage resp 没有分配对象
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYiJun committed Mar 29, 2024
1 parent 7055cdd commit 8c0a918
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/sensitive/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func CheckSensitiveText(params ParamsForCheck) (resp *ResponseForCheck, err erro
if err != nil {
// 处理错误并打印日志
utils.RequestLog(fmt.Sprintf("sync request error:%+v", err.Error()), params.TypeName, params.Id, false)
resp = nil
return &ResponseForCheck{Pass: false}, nil
}

resp = &ResponseForCheck{}
Expand Down Expand Up @@ -136,9 +136,11 @@ func checkSensitiveImage(params ParamsForCheck) (resp *ResponseForCheck, err err
if err != nil {
// 处理错误并打印日志
utils.RequestLog(fmt.Sprintf("sync request error:%+v", err.Error()), params.TypeName, params.Id, false)
resp = nil
// TODO: 通知管理员
return &ResponseForCheck{Pass: false}, nil
}

resp = &ResponseForCheck{}
if response.GetCode() == 200 {
if len(*response.Result) == 0 {
return nil, fmt.Errorf("sensitive image check returns empty response")
Expand Down

0 comments on commit 8c0a918

Please sign in to comment.