IndexController.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\controller;
  3. use support\Request;
  4. use Webman\Push\Api;
  5. class IndexController
  6. {
  7. public function index(Request $request)
  8. {
  9. // $api = new Api('http://127.0.0.1:3232', config('plugin.webman.push.app.app_key'),config('plugin.webman.push.app.app_secret'));
  10. // $api->trigger("user-_000KmfiVkio30K9VxoeLUUY3_hngEWcgR7u","message",[
  11. // "type" => "text",
  12. // "time" => time() * 1000,
  13. // "msgId" => time(),
  14. // "content" => "哈稍等哈就说客家话",
  15. // "source" => 2,
  16. // "avatar" => "https://washmy.oss-cn-guangzhou.aliyuncs.com/storage/20260511/23627b2cb8f73a8a90b95c31d726e6ecad0cbb9a.png",
  17. // "poi_id" => "7644106137976965139",
  18. // "openid" => "_000KmfiVkio30K9VxoeLUUY3_hngEWcgR7u",
  19. // "service_id" => "105"
  20. // ]);
  21. // echo "asd";
  22. // $param = [
  23. // "events" => [
  24. // [
  25. // "channel" => "private-user-1",
  26. // "name" => "channel_added"
  27. // ]
  28. // ]
  29. // ];
  30. // $key = hash_hmac('sha256', json_encode($param), config('plugin.webman.push.app.app_secret'), false);
  31. // echo $key."\n";
  32. return view('index');
  33. }
  34. public function view(Request $request)
  35. {
  36. return view('index/view', ['name' => 'webman']);
  37. }
  38. public function json(Request $request)
  39. {
  40. return json(['code' => 0, 'msg' => 'ok']);
  41. }
  42. }