开通消息推送配置遇到问题
- 当前 Bug 的表现(可附上截图)
- 预期表现
按照文档说明进行设置,并且在服务器端设置了校验代码,但是没有获取到echostr参数,其他字段都正常获取。
以下是使用https://mp.weixin.qq.com/debug/测试的结果
- 复现路径
按照文档说明正常设置即可
- 提供一个最简复现 Demo
$data = $this->request->param(); // TP框架获取get请求数据 $signature = $data["signature"]; $timestamp = $data["timestamp"]; $nonce = $data["nonce"]; $msg_signature = $data["msg_signature"]; $post_data = file_get_contents('php://input'); $encodingAesKey = "xxxxxxx"; $token = "xxxxxx"; // 校验signature是否正确 $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); $tmpStr = implode( $tmpArr ); $tmpStr = sha1( $tmpStr ); if( $tmpStr != $signature ){ $this->error('校验失败,返回信息错误!'); } else { echo $data['echostr'];exit(); } |
