add x-request-id defautl if under no-http-request

This commit is contained in:
dongwei 2019-07-03 13:19:40 +08:00
parent ac3f7bb737
commit 5930e7b9fc

View File

@ -96,7 +96,7 @@ class Client extends JsonRpc
try { try {
$headers = [ $headers = [
'X-Client-App' => $this->config['app'], 'X-Client-App' => $this->config['app'],
'X-Request-Id' => app('request')->header('X-Request-Id') 'X-Request-Id' => app('request')->header('X-Request-Id', md5(uniqid()))
]; ];
app('rpc.logger')->info("client_request", array_merge($this->server_config, $payload)); app('rpc.logger')->info("client_request", array_merge($this->server_config, $payload));
$resp = $this->http->request('POST', $uri, array_merge([ $resp = $this->http->request('POST', $uri, array_merge([