<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\Api\Middleware; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Session; class SessionMiddleware { public function handle(Request $kn_5b, \Closure $BuCHd) { goto ZTIm9; Js0hR: return $xCodt; goto EQXa8; AAwvb: if ($ushRB) { goto uoVdi; oL5iT: if ($xCodt instanceof $hwCm2) { $xCodt->header('api-token', $enKzx); } else { if ($xCodt instanceof $iILC2) { $xCodt->headers->set('api-token', $enKzx); } } goto noarB; uoVdi: $hwCm2 = 'Illuminate\\Http\\Response'; goto u6GQ2; u6GQ2: $iILC2 = 'Symfony\\Component\\HttpFoundation\\Response'; goto oL5iT; noarB: } goto Js0hR; zDriK: $enKzx = $this->get($kn_5b, 'api-token'); goto qrSET; tgFLf: $x4dPP = Session::getId(); goto DzDDp; v3TIh: $xCodt = $BuCHd($kn_5b); goto AAwvb; qrSET: if (empty($enKzx) || !Session::isValidId($enKzx)) { $enKzx = Session::getId(); $ushRB = true; } else { Session::setId($enKzx); $fdPo4 = true; } goto tgFLf; K5TkQ: $kn_5b->headers->set('api-param', $pOZpD); goto ajlpm; Hkqs_: $fdPo4 = false; goto zDriK; ZTIm9: $ushRB = false; goto Hkqs_; S9yDE: $kn_5b->headers->set('api-token', $enKzx); goto Orm9t; b8mCJ: if ($fdPo4) { Session::start(); } goto S9yDE; L0wgF: $kn_5b->headers->set('api-device', $n3MgZ); goto OxuYJ; OxuYJ: $pOZpD = $this->get($kn_5b, 'api-param'); goto K5TkQ; DzDDp: if ($x4dPP && $x4dPP != $enKzx) { Session::setId($enKzx); $fdPo4 = true; } goto b8mCJ; ajlpm: $hd2dx = $this->get($kn_5b, 'api-version'); goto De7EG; De7EG: $kn_5b->headers->set('api-version', $hd2dx); goto v3TIh; Orm9t: $n3MgZ = $this->get($kn_5b, 'api-device'); goto L0wgF; EQXa8: } private function get(Request &$kn_5b, $m1RYi) { goto B7psG; rJUjO: $tzAUI = $kn_5b->header($m1RYi); goto hZNWy; SZOmR: $tzAUI = Input::get($BT5mP, null); goto rkHke; hZNWy: if (!empty($tzAUI)) { return $tzAUI; } goto Y1UUh; ZYe1e: if (!empty($tzAUI)) { return $tzAUI; } goto qfIm1; Y1UUh: $tzAUI = $kn_5b->cookie($BT5mP); goto ZYe1e; B7psG: $BT5mP = str_replace('-', '_', $m1RYi); goto SZOmR; qfIm1: return null; goto TzyN9; rkHke: if (!empty($tzAUI)) { return $tzAUI; } goto rJUjO; TzyN9: } private function getCookieSessionId(Request &$kn_5b) { return $kn_5b->cookie(config('session.cookie')); } }