Commit a3675fda authored by hujun's avatar hujun

兼容authtoken

parent 17df8cba
......@@ -71,8 +71,15 @@ class Basic extends Controller
$jwt = new \Firebase\JWT\JWT();
$this->authToken = $this->params['AuthToken'];
$result = $jwt->decode($this->authToken, config('jwt_key'), array('HS256')); //解码token
$this->timeStamp_ = $result->timeStamp_;
$is = Db::table('agents')->where('phone', $result->data)->count();
if (isset($result->data->phone)) {
$phone = $result->data->phone;
} else {
$phone = $result->data;
}
$is = Db::table('agents')->where('phone', $phone)->count();
$this->agentPhone = $result->data;
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