diff --git a/app/controller/IndexController.php b/app/controller/IndexController.php index 8a06882..4a7af2b 100644 --- a/app/controller/IndexController.php +++ b/app/controller/IndexController.php @@ -75,6 +75,7 @@ class IndexController public function dataviewTouchPush(Request $request){ $parmas=$request->get(); + $channel = $parmas['channel']; $api = new Api( // webman下可以直接使用config获取配置,非webman环境需要手动写入相应配置 'http://127.0.0.1:3232', @@ -82,8 +83,8 @@ class IndexController config('plugin.webman.push.app.app_secret') ); // 给订阅 user-2 的所有客户端推送 message 事件的消息 - $api->trigger('user-2', 'message', [ - 'from_uid' => 2, + $api->trigger($channel, 'message', [ + 'from_uid' => $channel, 'content' => $parmas ]); return json(['code' => 0, 'msg' => 'ok', 'data'=>$parmas]);