Skip to content

Commit

Permalink
fix rpc判断
Browse files Browse the repository at this point in the history
fix rpc判断
  • Loading branch information
lobtao committed Apr 28, 2018
1 parent 140b7ba commit de327ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/RpcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function handle($namespace, $filter = null) {
$this->callback = $request->param('callback');

//过滤处理
if ($filter) {
if (isset($filter)) {
call_user_func_array($filter, [$this->func, $this->args]);
}

Expand Down
7 changes: 4 additions & 3 deletions src/RpcWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ class RpcWorker extends BaseRpc

/**
* 主方法
* @return string|\think\response\Json|\think\response\Jsonp
* @throws RpcException
* @param $namespace
* @param null $filter
* @return String|\think\response\Json|\think\response\Jsonp
*/
public function handle( $namespace, $filter = null) {
$this->namespace = $namespace;
Expand All @@ -35,7 +36,7 @@ public function handle( $namespace, $filter = null) {
$this->callback = isset($_REQUEST['callback']) ? $_REQUEST['callback'] : '';

//过滤处理
if ($filter) {
if (isset($filter)) {
call_user_func_array($filter, [$this->func, $this->args]);
}
$result = $this->callFunc($this->func, $this->args);
Expand Down

0 comments on commit de327ad

Please sign in to comment.