|
@@ -41,7 +41,10 @@ func (l *SensitiveMethodLogic) SensitiveMethod(in *commoninfo.SensitiveRequest)
|
|
|
log.Println("接收到敏感词回调----------------------", in)
|
|
|
upData := make(map[string]interface{})
|
|
|
query := make(map[string]interface{})
|
|
|
- attachments := mc.StringToMap(in.Attachments)
|
|
|
+ attachments := make(map[string]interface{})
|
|
|
+ if in.Attachments != "" {
|
|
|
+ attachments = mc.StringToMap(in.Attachments)
|
|
|
+ }
|
|
|
sensitiveAttach := make(map[string]interface{})
|
|
|
|
|
|
for k, v := range attachments {
|
|
@@ -57,12 +60,14 @@ func (l *SensitiveMethodLogic) SensitiveMethod(in *commoninfo.SensitiveRequest)
|
|
|
msg = append(msg, "敏感词识别失败")
|
|
|
}
|
|
|
} else if s, ok := vs["sensitive"]; ok && s != nil && len(s.([]interface{})) > 0 {
|
|
|
+ msg = mc.ObjArrToStringArr(vs["sensitive"].([]interface{}))
|
|
|
+ }
|
|
|
+ msgStr := strings.Join(msg, ",")
|
|
|
+ if msgStr != "" {
|
|
|
isAttach = true
|
|
|
- for _, v := range vs["sensitive"].([]interface{}) {
|
|
|
- msg = append(msg, mc.InterfaceToStr(v))
|
|
|
- }
|
|
|
+ log.Println("附件敏感词:", msgStr)
|
|
|
}
|
|
|
- sensitiveAttach[k] = strings.Join(msg, ",")
|
|
|
+ sensitiveAttach[k] = msgStr
|
|
|
}
|
|
|
if in.Title != nil || in.Detail != nil || isAttach {
|
|
|
isSensitive = true
|