Zory 1 ماه پیش
والد
کامیت
849b152254
3فایلهای تغییر یافته به همراه12 افزوده شده و 20 حذف شده
  1. 10 19
      app/controller/IndexController.php
  2. 1 0
      app/controller/api/Service.php
  3. 1 1
      config/plugin/webman/push/app.php

+ 10 - 19
app/controller/IndexController.php

@@ -8,25 +8,16 @@ class IndexController
 {
 {
     public function index(Request $request)
     public function index(Request $request)
     {
     {
-        return <<<EOF
-<style>
-  * {
-    padding: 0;
-    margin: 0;
-  }
-  iframe {
-    border: none;
-    overflow: scroll;
-  }
-</style>
-<iframe
-  src="https://www.workerman.net/wellcome"
-  width="100%"
-  height="100%"
-  allow="clipboard-write"
-  sandbox="allow-scripts allow-same-origin allow-popups allow-downloads"
-></iframe>
-EOF;
+        $param = [
+            "events" => [
+                [
+                    "channel"   => "private-user-1",
+                    "name"      => "channel_added"
+                ]
+            ]
+        ];
+        $key = hash_hmac('sha256', json_encode($param), config('plugin.webman.push.app.app_secret'), false);
+        echo $key."\n";
     }
     }
 
 
     public function view(Request $request)
     public function view(Request $request)

+ 1 - 0
app/controller/api/Service.php

@@ -26,6 +26,7 @@ class Service extends Base
     {
     {
         try {
         try {
             $param = $request->all();
             $param = $request->all();
+
         } catch (\Throwable $throwable) {
         } catch (\Throwable $throwable) {
             return error($throwable->getMessage());
             return error($throwable->getMessage());
         }
         }

+ 1 - 1
config/plugin/webman/push/app.php

@@ -5,6 +5,6 @@ return [
     'api'          => 'http://0.0.0.0:3232',
     'api'          => 'http://0.0.0.0:3232',
     'app_key'      => '265c33b73d5c04f918978577df2c48d2',
     'app_key'      => '265c33b73d5c04f918978577df2c48d2',
     'app_secret'   => '25774aa8461dcd54e5a318ba1e58f75b',
     'app_secret'   => '25774aa8461dcd54e5a318ba1e58f75b',
-    'channel_hook' => 'http://127.0.0.1:8787/plugin/webman/push/hook',
+    'channel_hook' => 'http://127.0.0.1:9881/plugin/webman/push/hook',
     'auth'         => '/plugin/webman/push/auth'
     'auth'         => '/plugin/webman/push/auth'
 ];
 ];