bug fix
This commit is contained in:
parent
e693f75563
commit
57335f98ce
|
@ -33,14 +33,14 @@ class Client
|
|||
*/
|
||||
public function call($uri, $params)
|
||||
{
|
||||
$config = array_merge(['timeout' => 1],
|
||||
$config = array_merge(['timeout' => 3],
|
||||
$this->config[$this->currentApp]);
|
||||
$secret = $config['secret'];
|
||||
unset($config['secret']);
|
||||
$client = new \GuzzleHttp\Client($config);
|
||||
$params['appid'] = $config['appid'];
|
||||
$params['timestamp'] = time();
|
||||
$key = $this->config[$this->currentApp]['secret'];
|
||||
$params['sign'] = sign($params, $key);
|
||||
$params['sign'] = sign($params, $secret);
|
||||
$resp = $client->post($uri, ['form_params' => $params]);
|
||||
if ($resp->getStatusCode() == 200) {
|
||||
return \GuzzleHttp\json_decode($resp->getBody(), true);
|
||||
|
|
|
@ -18,9 +18,9 @@ class InternalApiServiceProvider extends ServiceProvider
|
|||
$this->app->singleton('internal.api', function () {
|
||||
return new Client(config('internal_api.client'));
|
||||
});
|
||||
foreach (config('internal_api.client') as $appid => $config) {
|
||||
$this->app->singleton('internal.api.' . $appid, function () use ($appid) {
|
||||
return $this->app['internal.api']->app($appid);
|
||||
foreach (config('internal_api.client') as $key => $config) {
|
||||
$this->app->singleton('internal.api.' . $key, function () use ($key) {
|
||||
return $this->app['internal.api']->app($key);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user