Commit f4ba4ae3 authored by clone's avatar clone

time

parent dac1d434
...@@ -82,7 +82,7 @@ class Basic extends Controller ...@@ -82,7 +82,7 @@ class Basic extends Controller
exit; exit;
} }
$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->id; $this->userId = $result->data->id;
$this->phone = $result->data->phone; $this->phone = $result->data->phone;
...@@ -95,9 +95,8 @@ class Basic extends Controller ...@@ -95,9 +95,8 @@ class Basic extends Controller
public function verifyTime() public function verifyTime()
{ {
$today = Time::today();
//authToken有效期为30天 //authToken有效期为30天
if (($today - $this->timeStamp_) > 2592000) { if ((time() - $this->timeStamp_) > 2592000) {
echo json_encode(array( "code" => "101", "msg" => "AuthToken失效,请重新登录!", "data" => [], "type" => "json" )); echo json_encode(array( "code" => "101", "msg" => "AuthToken失效,请重新登录!", "data" => [], "type" => "json" ));
exit; exit;
} }
......
...@@ -95,6 +95,7 @@ Route::group('api', [ ...@@ -95,6 +95,7 @@ Route::group('api', [
//post AppointmentTime //post AppointmentTime
'getAppointmentSeeShopList' => [ 'api/appointmentTime/getAppointmentSeeShopList', [ 'method' => 'post' ] ], 'getAppointmentSeeShopList' => [ 'api/appointmentTime/getAppointmentSeeShopList', [ 'method' => 'post' ] ],
'addAppointmentSeeShop' => [ 'api/appointmentTime/addAppointmentSeeShop', [ 'method' => 'post' ] ],
//tradeLog //tradeLog
......
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