shish 6 vuotta sitten
vanhempi
commit
89661ec631
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      app/saas/controllers/WxOpenController.php

+ 2 - 2
app/saas/controllers/WxOpenController.php

@@ -386,7 +386,7 @@ class WxOpenController extends PublicController
         $format = "<xml><ToUserName><![CDATA[toUser]]></ToUserName><Encrypt><![CDATA[%s]]></Encrypt></xml>";
         $from_xml = sprintf($format, $encrypt);
 
-        $formString = "token:" . $token . " \n encodingAesKey:" . $encodingAesKey . " \n appId:" . $appId . " \n msg_signature:" . $msg_signature . " \n appSecret:" . $appSecret . " \n timestamp:" . $timestamp . " \n nonce:" . $nonce . " \n from_xml:" . $from_xml;
+        $formString = " token:" . $token . " \n encodingAesKey:" . $encodingAesKey . " \n appId:" . $appId . " \n msg_signature:" . $msg_signature . " \n appSecret:" . $appSecret . " \n timestamp:" . $timestamp . " \n nonce:" . $nonce . " \n from_xml:" . $from_xml;
         Yii::warning($formString);
 
         //第三方收到公众号平台发送的消息
@@ -394,7 +394,7 @@ class WxOpenController extends PublicController
         $msg = '';//解密后的消息
         $errCode = $pc->decryptMsg($msg_signature, $timestamp, $nonce, $from_xml, $msg);
         if ($errCode != 0) {
-            Yii::warning("解密未成功,错误代码:" . $errCode);
+            Yii::warning("解密未成功,错误代码:" . $errCode . "。(出现过的情况汇总:-40001 有可能token填写不对)");
             util::stop();
         }
         $postObj = simplexml_load_string($msg, 'SimpleXMLElement', LIBXML_NOCDATA);