Ver Fonte

[智价云] 订阅通知校验更新

tangyuanwang há 3 dias atrás
pai
commit
7fa2913ecf
1 ficheiros alterados com 1 adições e 0 exclusões
  1. 1 0
      app/Http/Controllers/Api/Wechat/OfficialNotify.php

+ 1 - 0
app/Http/Controllers/Api/Wechat/OfficialNotify.php

@@ -23,6 +23,7 @@ class OfficialNotify extends Controller
         $xmlData = file_get_contents('php://input');
         $xml = simplexml_load_string($xmlData, 'SimpleXMLElement', LIBXML_NOCDATA);
         $Official = new Official();
+        if(!$xml) return 'success';
         // 提取关键信息
         $fromUsername = (string)$xml->FromUserName;  // 用户的公众号OpenID
         $toUsername = (string)$xml->ToUserName;      // 公众号原始ID