Commit 3ffa8e14 authored by hujun's avatar hujun

检查AuthToken

parent 6880bf0e
...@@ -68,8 +68,8 @@ class Basic extends Controller ...@@ -68,8 +68,8 @@ class Basic extends Controller
} elseif (strtoupper($this->request->method()) === "POST") { } elseif (strtoupper($this->request->method()) === "POST") {
$this->params = $this->request->param() != null ? $this->request->param() : null; $this->params = $this->request->param() != null ? $this->request->param() : null;
} }
$AuthToken = $this->params['AuthToken'];
if (isset($this->params['AuthToken'])) { if (isset($AuthToken) && $AuthToken != 'null' && !empty($AuthToken)) {
$jwt = new \Firebase\JWT\JWT(); $jwt = new \Firebase\JWT\JWT();
$this->authToken = $this->params['AuthToken']; $this->authToken = $this->params['AuthToken'];
$result = $jwt->decode($this->authToken, config('jwt_key'), array( 'HS256' )); //解码token $result = $jwt->decode($this->authToken, config('jwt_key'), array( 'HS256' )); //解码token
......
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