变更
This commit is contained in:
@@ -56,7 +56,7 @@ abstract class JsonRpcConsumers implements OnRpcConsumerInterface
|
|||||||
$this->client->withConfig($this->get_consul($this->name))->sendRequest(
|
$this->client->withConfig($this->get_consul($this->name))->sendRequest(
|
||||||
$this->requestBody([
|
$this->requestBody([
|
||||||
'jsonrpc' => $version,
|
'jsonrpc' => $version,
|
||||||
'service' => $this->name,
|
'service' => str_starts_with($this->name, '/') ? $this->name : '/' . $this->name,
|
||||||
'method' => $method,
|
'method' => $method,
|
||||||
'params' => $data,
|
'params' => $data,
|
||||||
])
|
])
|
||||||
@@ -91,7 +91,7 @@ abstract class JsonRpcConsumers implements OnRpcConsumerInterface
|
|||||||
return $this->client->withConfig($this->get_consul($this->name))->sendRequest(
|
return $this->client->withConfig($this->get_consul($this->name))->sendRequest(
|
||||||
$this->requestBody([
|
$this->requestBody([
|
||||||
'jsonrpc' => $version,
|
'jsonrpc' => $version,
|
||||||
'service' => $this->name,
|
'service' => str_starts_with($this->name, '/') ? $this->name : '/' . $this->name,
|
||||||
'method' => $method,
|
'method' => $method,
|
||||||
'params' => $data,
|
'params' => $data,
|
||||||
'id' => $id
|
'id' => $id
|
||||||
|
|||||||
@@ -226,9 +226,6 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa
|
|||||||
private function dispatch($data): array
|
private function dispatch($data): array
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (!str_starts_with($data['service'], '/')) {
|
|
||||||
$data['service'] = '/' . $data['service'];
|
|
||||||
}
|
|
||||||
$handler = $this->collector->find($data['service'], 'GET');
|
$handler = $this->collector->find($data['service'], 'GET');
|
||||||
if (is_integer($handler) || is_null($handler)) {
|
if (is_integer($handler) || is_null($handler)) {
|
||||||
throw new Exception('Handler not found', -32601);
|
throw new Exception('Handler not found', -32601);
|
||||||
|
|||||||
Reference in New Issue
Block a user