Commit 021e7167 authored by clone's avatar clone

basic类

parent 014ba7c4
...@@ -32,8 +32,6 @@ class Shop extends Basic ...@@ -32,8 +32,6 @@ class Shop extends Basic
"shangpu_tags" => "临近地铁," "shangpu_tags" => "临近地铁,"
);*/ );*/
$params = $this->params; $params = $this->params;
$field = "id,agent_id,title,address,city,disc,disccircles,sales,yetai,room_area2,shangpu_type,is_test, $field = "id,agent_id,title,address,city,disc,disccircles,sales,yetai,room_area2,shangpu_type,is_test,
room_num_left,shangpu_tags,carefully_chosen,price"; room_num_left,shangpu_tags,carefully_chosen,price";
......
...@@ -41,28 +41,33 @@ class Basic extends Controller ...@@ -41,28 +41,33 @@ class Basic extends Controller
*/ */
public function __construct(Request $request = null) public function __construct(Request $request = null)
{ {
ob_start();
ob_end_flush();
ob_end_clean();
ob_get_contents();
// CORS 跨域 Options 检测响应 // CORS 跨域 Options 检测响应
$this->corsOptionsHandler(); $this->corsOptionsHandler();
// 输入对象 // 输入对象
$this->request = is_null($request) ? Request::instance() : $request; $this->request = is_null($request) ? Request::instance() : $request;
if (strtoupper($this->request->method()) === "GET") { if (strtoupper($this->request->method()) === "GET") {
$this->params = $this->request->param(); $this->params = $this->request->param();
} elseif (strtoupper($this->request->method()) === "POST") { } elseif (strtoupper($this->request->method()) === "POST") {
$this->params = json_decode($this->request->param()); $this->params = $this->request->getContent() != null ? json_decode($this->request->getContent(),true) : null;
} }
$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
$this->userId = $result['data']["userId"]; $this->userId = $result['data']["userId"];
$this->phone = $result['data']["phone"]; $this->phone = $result['data']["phone"];
$this->timeStamp_ = $result["timeStamp_"]; $this->timeStamp_ = $result["timeStamp_"];
$this->verifyTime(); $this->verifyTime();*/
} }
......
...@@ -55,7 +55,7 @@ Route::group('api',[ ...@@ -55,7 +55,7 @@ Route::group('api',[
'register' => ['api/member/register',['method'=> 'post']], //邀请注册 'register' => ['api/member/register',['method'=> 'post']], //邀请注册
//post shop //post shop
'shopList' => ['api/shop/getShopList', ['method' => 'get']], 'shopList' => ['api/shop/getShopList', ['method' => 'post']],
]); ]);
\ No newline at end of file
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