Skip to content

Commit de327ad

Browse files
author
lobtao
committed
fix rpc判断
fix rpc判断
1 parent 140b7ba commit de327ad

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/RpcController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function handle($namespace, $filter = null) {
3131
$this->callback = $request->param('callback');
3232

3333
//过滤处理
34-
if ($filter) {
34+
if (isset($filter)) {
3535
call_user_func_array($filter, [$this->func, $this->args]);
3636
}
3737

src/RpcWorker.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ class RpcWorker extends BaseRpc
1616

1717
/**
1818
* 主方法
19-
* @return string|\think\response\Json|\think\response\Jsonp
20-
* @throws RpcException
19+
* @param $namespace
20+
* @param null $filter
21+
* @return String|\think\response\Json|\think\response\Jsonp
2122
*/
2223
public function handle( $namespace, $filter = null) {
2324
$this->namespace = $namespace;
@@ -35,7 +36,7 @@ public function handle( $namespace, $filter = null) {
3536
$this->callback = isset($_REQUEST['callback']) ? $_REQUEST['callback'] : '';
3637

3738
//过滤处理
38-
if ($filter) {
39+
if (isset($filter)) {
3940
call_user_func_array($filter, [$this->func, $this->args]);
4041
}
4142
$result = $this->callFunc($this->func, $this->args);

0 commit comments

Comments
 (0)