| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\controller;
- use support\Request;
- use Webman\Push\Api;
- class IndexController
- {
- public function index(Request $request)
- {
- $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",
- "openid" => "_000KmfiVkio30K9VxoeLUUY3_hngEWcgR7u",
- "service_id" => "105"
- ]);
- 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)
- {
- return view('index/view', ['name' => 'webman']);
- }
- public function json(Request $request)
- {
- return json(['code' => 0, 'msg' => 'ok']);
- }
- }
|