shish vor 8 Monaten
Ursprung
Commit
ccbf1d7468

+ 1 - 2
common/components/rabbitmq/consumer/customConsumer.php

@@ -26,8 +26,7 @@ class customConsumer implements ConsumerInterface
     {
         try {
             // 反序列化消息体
-            $data = json_decode($msg->body, true);
-            
+            $data = unserialize($msg->body);
             if (!is_array($data)) {
                 Yii::error("Invalid custom message format: {$msg->body}", 'rabbitmq.custom');
                 return ConsumerInterface::MSG_REJECT;

+ 1 - 1
common/components/rabbitmq/consumer/stockConsumer.php

@@ -26,7 +26,7 @@ class stockConsumer implements ConsumerInterface
     {
         try {
             // 反序列化消息体
-            $data = json_decode($msg->body, true);
+            $data = unserialize($msg->body);
             
             if (!is_array($data)) {
                 Yii::error("Invalid stock message format: {$msg->body}", 'rabbitmq.stock');