Skip to content

Commit

Permalink
更新一下方法
Browse files Browse the repository at this point in the history
  • Loading branch information
lovefc committed Nov 18, 2019
1 parent 2ddc2d3 commit 2f8d207
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,18 @@ public function checkApi($name)
return true;
}
if (!in_array($name, $this->scope)) {
die("没有{$name}接口调用权限");
return false;
}
return true;
}

// 魔术方法,自动判断接口权限并执行函数
public function __call($method, $args)
{
$name = str_replace('_', '.', $method);
$this->checkApi($name);
if($this->checkApi($name) === false){
die("没有{$name}接口调用权限");
}
return $this->runPddApi($name, $args);
}

Expand Down

0 comments on commit 2f8d207

Please sign in to comment.