ComposerUpdate

This commit is contained in:
Anyon 2020-12-18 13:44:03 +08:00
parent dadea2512e
commit 90eaa705cc
4 changed files with 13 additions and 10 deletions

View File

@ -937,12 +937,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "1fe6534d9075bcd3c421e6ef7399ac32341ac7f4"
"reference": "f8a4e65cf6b57531c8536462b30892eae49c7809"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/1fe6534d9075bcd3c421e6ef7399ac32341ac7f4",
"reference": "1fe6534d9075bcd3c421e6ef7399ac32341ac7f4",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/f8a4e65cf6b57531c8536462b30892eae49c7809",
"reference": "f8a4e65cf6b57531c8536462b30892eae49c7809",
"shasum": "",
"mirrors": [
{
@ -959,7 +959,7 @@
"ext-mbstring": "*",
"topthink/framework": "^6.0"
},
"time": "2020-12-16T07:15:01+00:00",
"time": "2020-12-18T05:04:10+00:00",
"type": "library",
"extra": {
"think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2020-12-17 10:58:31
// This file is automatically generated at:2020-12-18 13:43:33
declare (strict_types = 1);
return array (
0 => 'think\\admin\\Library',

View File

@ -17,6 +17,8 @@ declare (strict_types=1);
namespace think\admin\extend;
use think\admin\Exception;
/**
* JsonRpc 客户端
* Class JsonRpcClient
@ -51,7 +53,7 @@ class JsonRpcClient
* @param string $method
* @param array $params
* @return mixed
* @throws \think\admin\Exception
* @throws Exception
*/
public function __call(string $method, array $params)
{
@ -75,16 +77,16 @@ class JsonRpcClient
fclose($fp);
$response = json_decode($response, true);
} else {
throw new \think\admin\Exception("无法连接到 {$this->proxy}");
throw new Exception("无法连接到 {$this->proxy}");
}
// Final checks and return
if ($response['id'] != $this->id) {
throw new \think\admin\Exception("错误的响应标记 (请求标记: {$this->id}, 响应标记: {$response['id']}");
throw new Exception("错误标记 (请求标记: {$this->id}, 响应标记: {$response['id']}");
}
if (is_null($response['error'])) {
return $response['result'];
} else {
throw new \think\admin\Exception("请求错误:{$response['error']['message']}", $response['error']['code']);
throw new Exception("请求错误:{$response['error']['message']}", $response['error']['code']);
}
}
}

View File

@ -73,7 +73,8 @@ class JsonRpcServer
$response = ['jsonrpc' => '2.0', 'id' => $request['id'], 'result' => null, 'error' => $error];
} else try {
// Executes the task on local object
if ($result = @call_user_func_array([$object, $request['method']], $request['params'])) {
if (method_exists($object, $request['method'])) {
$result = call_user_func_array([$object, $request['method']], $request['params']);
$response = ['jsonrpc' => '2.0', 'id' => $request['id'], 'result' => $result, 'error' => null];
} else {
$error = ['code' => '-32601', 'message' => '找不到方法', 'meaning' => '该方法不存在或无效'];