Skip to content

Commit

Permalink
fix $authVerifyFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
lobtao committed Jan 22, 2022
1 parent 5caf480 commit 7b820bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@

// 该部分可以放在控制器方法内, 以提供通用调用服务
try {
$data = $rpc->handle('lobtao\\example\\service\\', $func, $args, function ($f, $p) {
$data = $rpc->handle('lobtao\\example\\service\\', $func, $args, function () use ($func) {
// 白名单函数
$while_funcs = [
'test_func1',
'test_func2',
];

if (in_array($f, $while_funcs)) {
if (in_array($func, $while_funcs)) {
return true;
}

if ($f == 'test_func') {
if ($func == 'test_func') {
throw new RpcException('禁止访问函数');
}

Expand Down

0 comments on commit 7b820bc

Please sign in to comment.