- 小程序-消息推送-40001?
发送失败,错误编码:40001错误信息:invalid credential, access_token is invalid or not latest rid: 617fcd4a-023d5621-0fdd951e" public function sendwxmessage() { // $param = $this->request->param(); $openid = '123123123'; $templateId = '123123123'; $data = '消息通知'; $access_token = '来自前端点击后 获取到的 数据库中也是实时更新的'; $url = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=" . $access_token; $params1 = array( "touser" => $openid, "template_id" => $templateId, "data" => $data, ); $json_template = json_encode($params1); $params = $this->curl_post($url, urldecode($json_template)); $params = json_decode($params, true); if ($params['errcode'] == 0) { return json(['code' => 1, 'msg' => '发送成功']); } else { return json(['code' => -1, 'msg' => '发送失败,错误编码:'.$params['errcode']."错误信息:".$params['errmsg']]); } //$this->success('请求成功!'); } public function http_curl($url) { //用curl传参 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //关闭ssl验证 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_HEADER, 0); $output = curl_exec($ch); curl_close($ch); return json_decode($output, true); } public function curl_post($url, $data = array()) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // POST数据 curl_setopt($ch, CURLOPT_POST, 1); // 把post的变量加上 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $output = curl_exec($ch); curl_close($ch); return $output; }
2021-11-01 - 域名被微信公众号拉黑,求解除?
我司域名:www.sdlykj.com我司域名被恶意举报,我司也排查过原因 未能发现有违法信息及内容、 在腾讯网址安全中心网址举报/申诉的处理结果 是已申诉成功 但在微信上依旧被拦截 还请给指点下 [图片]
2020-05-09