Commit a39186e1 authored by clone's avatar clone

token 状态码

parent 85a6abd0
......@@ -10,6 +10,7 @@ namespace app\api\controller;
* Intro: 获取商铺list
*/
use app\api\extend\Basic;
use app\model\AttentionModel;
use app\model\HouseImgs;
use app\model\HouseInfos;
use app\model\Labels;
......@@ -19,6 +20,7 @@ class Shop extends Basic
protected $db;
protected $dbImg;
protected $labels;
protected $attentionModel;
function __construct($request = null)
{
......@@ -26,6 +28,7 @@ class Shop extends Basic
$this->db = new HouseInfos();
$this->dbImg = new HouseImgs();
$this->labels = new Labels();
$this->attentionModel = new AttentionModel();
}
/**
......@@ -167,8 +170,14 @@ class Shop extends Basic
return $this->response("101", '此楼盘已下架');
}
//todo 查询关注门店
/* $attention["user_id"] =
getAttentionByUserIdAndHouseId($attention);*/
if (isset($this->userId)) {
$attention["user_id"] = $this->userId;
$attention["house_id"] = $params["id"];
$attention["is_del"] = 0;
$attResult = $this->attentionModel->getAttentionByUserIdAndHouseId($attention);
if (count($attResult) > 0)
$result ["attention"] = $attResult["id"];
}
return $this->response("200", 'request success', $result);
......
......@@ -89,7 +89,7 @@ class Basic extends Controller
*/
public function tokenVerify(){
if (!isset($this->params['AuthToken'])) {
echo json_encode(array( "code" => "101", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" ));
echo json_encode(array( "code" => "300", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" ));
exit;
}
$this->verifyUserInfo();
......@@ -101,7 +101,7 @@ class Basic extends Controller
{
//authToken有效期为30天
if ((time() - $this->timeStamp_) > 2592000) {
echo json_encode(array( "code" => "101", "msg" => "AuthToken失效,请重新登录!", "data" => [], "type" => "json" ));
echo json_encode(array( "code" => "300", "msg" => "AuthToken失效,请重新登录!", "data" => [], "type" => "json" ));
exit;
}
}
......@@ -111,7 +111,7 @@ class Basic extends Controller
$userModel = new Users();
$userArr = $userModel->selectUser($this->userId);
if (count($userArr) > 0 && ($userArr["id"] != $this->userId || $userArr["user_phone"] != $this->phone)) {
echo json_encode(array( "code" => "101", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json" ));
echo json_encode(array( "code" => "300", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json" ));
exit;
}
return true;
......
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