|
|
@@ -3,21 +3,33 @@
|
|
|
namespace app\controller;
|
|
|
|
|
|
use support\Request;
|
|
|
+use Webman\Push\Api;
|
|
|
|
|
|
class IndexController
|
|
|
{
|
|
|
public function index(Request $request)
|
|
|
{
|
|
|
- $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";
|
|
|
+ $api = new Api('http://127.0.0.1:3232', config('plugin.webman.push.app.app_key'),config('plugin.webman.push.app.app_secret'));
|
|
|
+ $api->trigger("user-_000KmfiVkio30K9VxoeLUUY3_hngEWcgR7u","message",[
|
|
|
+ "type" => "text",
|
|
|
+ "time" => time() * 1000,
|
|
|
+ "msgId" => time(),
|
|
|
+ "content" => "哈稍等哈就说客家话",
|
|
|
+ "source" => 2,
|
|
|
+ "avatar" => "https://washmy.oss-cn-guangzhou.aliyuncs.com/storage/20260511/23627b2cb8f73a8a90b95c31d726e6ecad0cbb9a.png",
|
|
|
+ "poi_id" => "7644106137976965139"
|
|
|
+ ]);
|
|
|
+ echo "asd";
|
|
|
+// $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)
|