Commit ed76aff3 authored by hujun's avatar hujun

注释用户数据库验证

parent 60c9aeb6
...@@ -365,9 +365,9 @@ class Broker extends Basic ...@@ -365,9 +365,9 @@ class Broker extends Basic
*/ */
public function getAgentsByPhone() { public function getAgentsByPhone() {
$agents = new Agents(); $agents = new Agents();
$data = $agents->getInfo($this->params['phone']); $data = $agents->getInfo($this->agentPhone);
$data['openid'] = ""; $data['openid'] = "";
$data['token'] = $this->authToken; $data['token'] = $this->authToken;
return $this->response(200, "", $data); return $this->response(200, "", $data);
} }
} }
\ No newline at end of file
...@@ -64,6 +64,7 @@ class Basic extends Controller ...@@ -64,6 +64,7 @@ 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;
} }
/*临时验证 start*/ /*临时验证 start*/
if (isset($this->params['AuthToken']) && $this->params['AuthToken'] != 'null' && !empty($this->params['AuthToken'])) { if (isset($this->params['AuthToken']) && $this->params['AuthToken'] != 'null' && !empty($this->params['AuthToken'])) {
$jwt = new \Firebase\JWT\JWT(); $jwt = new \Firebase\JWT\JWT();
...@@ -71,7 +72,7 @@ class Basic extends Controller ...@@ -71,7 +72,7 @@ class Basic extends Controller
$result = $jwt->decode($this->authToken, config('jwt_key'), array('HS256')); //解码token $result = $jwt->decode($this->authToken, config('jwt_key'), array('HS256')); //解码token
$this->timeStamp_ = $result->timeStamp_; $this->timeStamp_ = $result->timeStamp_;
$is = Db::table('agents')->where('phone', $result->data)->count(); $is = Db::table('agents')->where('phone', $result->data)->count();
$this->agentPhone = $result->data;
if ($is == 0) { if ($is == 0) {
echo json_encode(array("code" => "300", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json")); echo json_encode(array("code" => "300", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json"));
exit; exit;
...@@ -112,7 +113,7 @@ class Basic extends Controller ...@@ -112,7 +113,7 @@ class Basic extends Controller
echo json_encode(array( "code" => "300", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" )); echo json_encode(array( "code" => "300", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" ));
exit; exit;
} }
$this->verifyAgentInfo(); // $this->verifyAgentInfo();
$this->verifyTime(); $this->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