shish 6 anni fa
parent
commit
fb699db7e0
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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 . "。(出现过的情况汇总:-40001 有可能token填写不对)");
+            Yii::warning("解密未成功,错误代码:" . $errCode . "。(出现过的情况汇总:-40001 有可能token、encodingAesKey、appId等填写不对,请仔细核对每个值)");
             util::stop();
         }
         $postObj = simplexml_load_string($msg, 'SimpleXMLElement', LIBXML_NOCDATA);