zhuchengjie 3 gadi atpakaļ
vecāks
revīzija
dccaf2fad0
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 7 1
      app/Libs/Push/OPPOPush/OPPOPushCommon.php

+ 7 - 1
app/Libs/Push/OPPOPush/OPPOPushCommon.php

@@ -266,7 +266,13 @@ class OPPOPushCommon
         $body     = $response->getBody();
         $this->logPush(__FUNCTION__, 'body', compact('body'));
         $result    = json_decode($body, true);
-        $authToken = getProp($result['data'], 'auth_token');
+        if(isset($result['data']) && !empty($result['data'])){
+            $authToken = getProp($result['data'], 'auth_token');
+        }else{
+            $authToken = '';
+            $this->logPush(__FUNCTION__, 'result', $result);
+        }
+
         if (!$authToken) {
             throw new Exception('获取auth token失败');
         }