qiushang hai 8 meses
pai
achega
54701bf885
Modificáronse 1 ficheiros con 17 adicións e 17 borrados
  1. 17 17
      app/Http/Api/WechatOfficialController.php

+ 17 - 17
app/Http/Api/WechatOfficialController.php

@@ -47,26 +47,26 @@ class WechatOfficialController extends HttpBaseController
         }
     }
 
-    // public function index()
-    // {
-    //     $this->app->server->push(function ($message) {
-    //         $msgType = $message['MsgType'];
+    public function index()
+    {
+        $this->app->server->push(function ($message) {
+            $msgType = $message['MsgType'];
 
-    //         if ($msgType == 'event') {
-    //             $event = $message['Event'];
-    //             return $this->msgEvent($event, $message);
+            if ($msgType == 'event') {
+                $event = $message['Event'];
+                return $this->msgEvent($event, $message);
 
-    //         } else {
-    //             return $this->msgtType($msgType, $message);
-    //         }
-    //     });
+            } else {
+                return $this->msgtType($msgType, $message);
+            }
+        });
 
-    //     $response = $this->app->server->serve();
-    //     $response->send();
-    //     exit();
-    // }
+        $response = $this->app->server->serve();
+        $response->send();
+        exit();
+    }
 
-    public function index()
+    public function index2()
     {
         $this->app->server->push(function ($message) {
             $msgType = $message['MsgType'];
@@ -250,7 +250,7 @@ class WechatOfficialController extends HttpBaseController
                             'image' => 'https://www.qasimblog.com/static/login.jpg',
                         ]),
                         new NewsItem([
-                            'title' => '点击确认登录',
+                            'title' => $oauthUrl,
                             'description' => '',
                             'url' => $oauthUrl,
                             'image' => 'https://www.qasimblog.com/static/logo.png',