Commit cd91f68d authored by clone's avatar clone

token验证过滤

parent c7a03fb9
...@@ -69,6 +69,15 @@ class Basic extends Controller ...@@ -69,6 +69,15 @@ class Basic extends Controller
$requestPath = $this->request->path(); $requestPath = $this->request->path();
//过滤掉不需要验证token的接口 //过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) { if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
}
}
/**
* token 验证
*/
public function tokenVerify(){
if (!isset($this->params['AuthToken'])) { if (!isset($this->params['AuthToken'])) {
echo json_encode(array( "code" => "101", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" )); echo json_encode(array( "code" => "101", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" ));
exit; exit;
...@@ -84,8 +93,6 @@ class Basic extends Controller ...@@ -84,8 +93,6 @@ class Basic extends Controller
$this->verifyTime(); $this->verifyTime();
} }
}
public function verifyTime() public function verifyTime()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment