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.
31 lines
568 B
31 lines
568 B
<?php
|
|
|
|
namespace WeWork\ApiCache;
|
|
|
|
use WeWork\Traits\HttpClientTrait;
|
|
use WeWork\Traits\SecretTrait;
|
|
|
|
class JsApiTicket extends AbstractApiCache
|
|
{
|
|
use SecretTrait, HttpClientTrait;
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
protected function getCacheKey(): string
|
|
{
|
|
$unique = md5($this->secret);
|
|
|
|
return md5('wework.api.js_ticket.' . $unique);
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
protected function getFromServer(): string
|
|
{
|
|
$data = $this->httpClient->get('get_jsapi_ticket');
|
|
|
|
return $data['ticket'];
|
|
}
|
|
}
|
|
|