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.

23 lines
644 B

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