微信公开课
微信公开课小程序热门讨论关于「微信小程序客服取不到文件」的小程序开发问题
补充:微信小程序客服取不到文件
展开:请教,微信小程序客服$postStr=file_get_contents(php:input);获取不到文件,消息推送已经启用,如果openid填写好推正常,人工 客服也正常,是什么原因,谢谢publicfunctionresponseMsg() { getpostdata,Maybeduetothedifferentenvironments $postStr=file_get_contents(php:input); if(empty($postStr)){ echo$ivar1为空或为0PHP_EOL;}else{ echo$ivar1不为空或不为0PHP_EOL;} print_r($postStr); extractpostdataif(!empty($postStr)){ *libxml_disable_entity_loaderistopreventXMLeXternalEntityInjection, thebestwayistocheckthevalidityofxmlbyyourself* libxml_disable_entity_loader(true); $postObj=simplexml_load_string($postStr,SimpleXMLElement,LIBXML_NOCDATA); $fromUsername=trim($postObjFromUserName); echo$postObj; $toUsername=$postObjToUserName; $keyword=trim($postObjContent); $time=time(); $appid=wx778804e73c086080;$secret=2b93a9c0916d3f1ce73b5e5be5216f2c; $gettoken=https:apiweixinqqcomcgibintoken?grant_type=client_credential&appid={$appid}&secret={$secret}; $result=$thishttpGet($gettoken); $arr=json_decode($result,true); $token=$arr[access_token]; var_dump($result); $postmsg=https:apiweixinqqcomcgibinmessagecustomsend?access_token=$token; $textTpl={touser:$fromUsername,msgtype:text,text:{content:HelloWorld你好世界}}; $resultStr=$thisposturl($postmsg,$textTpl); echo$resultStr;
更多有关「微信小程序客服取不到文件」的讨论可以前往微信公开课小程序参与互动哦!了解更多