Browse Source

fixed: 兼容array Or object.

gwang 3 years ago
parent
commit
f3b6bc0cca
1 changed files with 8 additions and 2 deletions
  1. 8 2
      Gameserver/Amfphp/base/Resp.php

+ 8 - 2
Gameserver/Amfphp/base/Resp.php

@@ -48,8 +48,14 @@ class Resp extends Object_ext {
         $this->events = self::$ext_events;
         self::$ext_events = array();
         if (count($this->events) > 0) {
-            if (!array_key_exists('store', (array) $this->result)) {
-                $this->result['store'] = req()->userInfo->game->store;
+            if (is_array($this->result)) {
+                if (!array_key_exists('store', (array) $this->result)) {
+                    $this->result['store'] = req()->userInfo->game->store;
+                }
+            } else {
+                if (!array_key_exists('store', (array) $this->result)) {
+                    $this->result->store = req()->userInfo->game->store;
+                }
             }
         }
     }