Commit 2a618214 authored by hujun's avatar hujun

增加判断jwt

parent 20501bf5
......@@ -69,9 +69,13 @@ class Basic extends Controller
$jwt = new JWT();
$this->authToken = $this->params['AuthToken'];
$result = $jwt->decode($this->authToken, config('jwt_key'), array('HS256')); //解码token
if (isset($result->data)) {
$this->timeStamp_ = $result->timeStamp_;
$this->agentPhone = $result->data->phone;
$is = Db::table('agents')->where('phone', $result->data->phone)->count();
$is = Db::table('agents')->where('phone', $this->agentPhone)->count();
} else {
$is = 0;
}
if ($is == 0) {
echo json_encode(array("code" => "300", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json"));
......
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