//以下传参是可以的(有点奇怪,但是解决了~) 必须'scene' => 2, $params = [ 'openid' => $open_id['openid'], 'scene' => 2, 'version' => 2, 'content' => $content, ]; if($title) $params['title'] = $title;
文本内容安全识别不出敏感词呢?我写的哪里有问题呀,急急部分代码如下: $access_token = json_decode($this->access_token())->access_token; $endpoint = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=".$access_token; Log::info('微信检测敏感词url',[$endpoint]); $params = [ 'openid' => $open_id['openid'], 'scene' => 4, 'version' => 2, 'content' => "测试数据:反动分子大麻海洛因台独一个台湾测试数据", ]; Log::info('微信检测敏感词params',[$params]); $result = $this->postsCurl($params,$endpoint); return [true,$result]; } public function postsCurl(array $data,$endpoint) { // 构造请求头 $headers = array( 'Content-Type: application/json' ); // 定义变量 $url = $endpoint; $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); Log::info('微信检测敏感词检测结果',[$response]); return json_decode($response, true); } Log打印结果: [2024-07-24 14:23:30] local.INFO: 微信检测敏感词params [{"openid":"oo5Kt5GkFBZMSfVuspTWWU","scene":4,"version":2,"content":"测试数据:反动分子大麻海洛因台独一个台湾测试数据"}] [2024-07-24 14:23:30] local.INFO: 微信检测敏感词url ["https://api.weixin.qq.com/wxa/msg_sec_check?access_token=82_uKM2Ag80M7rrrwcZ5FnLxpjZkRyjPkagvd_-3FAOREVUNFEYzhltzKEiF0_fX2C6BxzkdSr_jJslZwySgCYghObBGGCEXOicCpc2q2VxgLrqzDE7aw_EACALLM"] 微信检测敏感词检测结果:{ "errcode": 0, "errmsg": "ok", "detail": [ { "strategy": "keyword", "errcode": 0 }, { "strategy": "content_model", "errcode": 0, "suggest": "pass", "label": 100, "prob": 90 } ], "trace_id": "66a09de2-154c2720-2cb5f", "result": { "suggest": "pass", "label": 100 } }
07-24这里有个文档,让前端做的,可以实现https://work.weixin.qq.com/api/doc/90000/90136/93582
用户通过小程序添加企业微信好友,怎么实现?请问小程序是否支持在微信小游戏内跳转添加企业微信的好友呢?如何实现?
2021-05-25