请问怎么解决的?
问,msg_sec_check 文本安全内容检测接口有问题?已知: //---------------------------------------------------------------------- 参数:{"content":"123"} 返回:{"errcode":0,"errmsg":"ok"} //---------------------------------------------------------------------- 参数:{"content":"啊啊啊"} 返回:{"errcode":47001,"errmsg":"data format error hint: [lGLDNHnre-ImJoCA] rid: 5f435cee-0f9a6db9-14d2572d"} //---------------------------------------------------------------------- 参数:{"content":"F**k The Communist Party of China"} 返回:{"errcode":0,"errmsg":"ok"} //---------------------------------------------------------------------- 结果就是,把中文转换成urlencode或者是unicode,无论发送什么内容都返回OK,英文一些常见脏字也都返回OK。 很明显是不对的。
2020-11-09解决了吗? 遇到同样的问题了 ,求助
java写的敏感词检测msg_sec_check 提示47001?java写的代码 access_token已经确认正确无误 unicode已经转换成utf-8 下面是代码 [图片] 这是调取后的结果 [图片]
2020-11-09请问能上传相关代码吗, 我这边改了之后还是始终都是"0"
敏感词判断接口一个很奇怪的问题,msgSecCheck,总是返回 0,原因未知?完整代码如下: log.info("微信敏感词判断,令牌:{} 内容:{}",access_token,content); try { Map<String, Object> params = new HashMap<>(); params.put("content", content); //参数 CloseableHttpClient httpClient = HttpClientBuilder.create().build(); String url = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN"; url = StringUtils.replace(url, "ACCESS_TOKEN", access_token); HttpPost httpPost = new HttpPost( url ); // 接口 httpPost.addHeader(HTTP.CONTENT_TYPE, "application/json"); String body = JSON.toJSONString(params); //必须是json模式的 post log.info("请求微信服务器敏感词检查:{}",body); StringEntity entity = new StringEntity(body); httpPost.setEntity(entity); HttpResponse response = httpClient.execute(httpPost); InputStream inputStream = response.getEntity().getContent(); BufferedReader in = new BufferedReader(new InputStreamReader(inputStream,"utf-8")); String line; String message = ""; while ((line = in.readLine()) != null) { message += line; } log.info("微信服务器敏感词检查接口:{}",message); String errcode = takeString(message,"errcode"); if(StringUtil.isBlank(errcode) || Integer.parseInt(errcode)==0) { //无敏感词 return ""; } else if(errcode.compareTo("44002")==0) { //令牌失效 this.accessTokenSave(""); return ("微信访问令牌失效,请重新再试"); } else if(errcode.compareTo("87014")==0) { return "包含敏感词信息"; } else { return errcode; } } catch(Exception e) { e.printStackTrace(); return "接口错误:" + e.getMessage(); } 测试数据和结果如下: 请求微信服务器敏感词检查:{"content":"特3456书yuuo莞6543李zxcz蒜7782法fgnv级"} 微信服务器敏感词检查接口:{"errcode":0,"errmsg":"ok"} 无论我如何改变关键词,结果都是0,肯定是接口调用无效,但是又没有明确的错误信息,这样导致小程序无法上线,实在坑的冤枉啊!
2020-11-09请问问题解决了吗
敏感词检测msg_sec_check无效,提示 {"errcode":0,"errmsg":"ok"使用HTTPS 调用,发现输入什么关键字都返回 0,ok代码如下:这个需要转格式? public JsonResult> PostmsgSecCheck(Content content) { var ret = Security.msgSecCheck(content.Body); return JsonResult(new { errcode = ret.errcode, errmsg = ret.errmsg }); } public dynamic msgSecCheck(string content) { var msg = new { content }; string jsonString = HttpHelper.HttpPost(url, JsonConvert.SerializeObject(msg)); var json = JsonConvert.DeserializeObject(jsonString); return new { json.errcode, json.errmsg }; } public static string HttpPost(string Url, string postDataStr) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url); request.Method = "POST"; //request.ContentType = "application/x-www-form-urlencoded"; request.ContentType = "application/json"; request.ContentLength = postDataStr.Length; StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII); writer.Write(postDataStr); writer.Flush(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string encoding = response.ContentEncoding; if (encoding == null || encoding.Length < 1) { encoding = "UTF-8"; //默认编码 } StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding)); string retString = reader.ReadToEnd(); return retString; }
2020-11-09请问问题解决了吗?
POST https://api.weixin.qq.com/wxa/msg_sec_check?POST https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN 为什么我这个接口后台调用一直返回成功,不管我输入什么content参数都返回成功
2020-11-09请问解决了么 , 怎么解决的
access_token missing hint返回失败?appid wxb37afa642be7f594 调用https://api.weixin.qq.com/wxa/msg_sec_check接口 为什么返回{"errcode":41001,"errmsg":"access_token missing hints: [YHoCLhqge-B0T9Qa!]"} 16:52调用 谢谢
2020-11-09