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.
|
|
|
<?php
|
|
|
|
namespace app\home\service;
|
|
|
|
|
|
|
|
use app\model\UserModel;
|
|
|
|
|
|
|
|
class NoticeService extends BaseHomeService
|
|
|
|
{
|
|
|
|
public function generateToken($param): array
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
if (!isset($param['user_id'])) {
|
|
|
|
return [
|
|
|
|
'token' => "",
|
|
|
|
];
|
|
|
|
}
|
|
|
|
// 生成Beams身份验证令牌
|
|
|
|
$token = (new \app\utility\Pusher())->generateToken($param['user_id']);
|
|
|
|
return $token;
|
|
|
|
} catch (\Exception $exception) {
|
|
|
|
return $this->toData('500', lang('system_busy'), [$exception->getMessage(), $exception->getTrace()]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|