p2 project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1013 B

2 months ago
<?php
namespace app\admin\controller;
use app\admin\service\NoticeService;
class Notice extends AdminBaseController
{
// 弹窗通知消息
public function popUp()
{
$returnData = (new NoticeService())->popUp($this->request->param());
return json($returnData);
}
2 months ago
// 使用Pusher服务推送系统消息
public function pushMessage()
{
1 month ago
$param = $this->request->post();
2 months ago
if (empty($param['title']) || empty($param['body'])) {
return json([
'code' => 400,
'message' => "缺少参数",
'data' => []
]);
}
$interestName = ["admin-popup-push"]; // 订阅兴趣的名称, 一次推送最多100个兴趣名称
$title = "";
$body = "";
$res = (new \app\utility\Pusher())->publishToInterest($interestName, $title, $body);
1 month ago
return json([
'code' => 0,
'message' => 'ok',
'data' => $res
]);
}
2 months ago
}