在开发微信第三方平台,微信平台会每隔10分钟以POST的方式推送,看了网站日志确实有推送,我用post接收并写入插件缓存,却怎么也接收不到,是我哪里写错了,用的是最新1.4版的,
public function index() { //接收传过来的参数 10分钟一次 $request = Request::instance(); $timeStamp = ''; if($this->request->isPost()){ $timeStamp = $request->post('timestamp'); } $nonce = $this->request->request('nonce'); $encrypt_type = $request->get('encrypt_type'); $msg_sign = $this->request->post('msg_signature'); $encryptMsg = file_get_contents('php://input'); $a = $timeStamp.'|'.$nonce.'|'.$encrypt_type.'|'.$msg_sign; thinkCache::tag('pyuyue')->set('a',$a); thinkCache::tag('pyuyue')->set('b',$encryptMsg); //echo thinkCache::tag('pyuyue')->get('a'); //var_dump(thinkCache::tag('pyuyue')->get('b')); //$result = $this->getVerify_Ticket($timeStamp,$nonce,$encrypt_type,$msg_sign,$encryptMsg); $result = 1; if($result){ echo "success"; } }
希望以上内容对你有所帮助!如果还有其他问题,请随时提问。 各类知识收集 拥有多年CMS企业建站经验,对 iCMS, Fastadmin, ClassCMS, LeCMS, PbootCMS, PHPCMS, 易优CMS, YzmCMS, 讯睿CMS, 极致CMS, Wordpress, HkCMS, YznCMS, WellCMS, ThinkCMF, 等各类cms的相互转化,程序开发,网站制作,bug修复,程序杀毒,插件定制都可以提供最佳解决方案。