<?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 $cSn43, \Closure $aPZzJ) { goto kSGpD; UmWEd: $G2Lvz = $this->get($cSn43, 'api-param'); goto uAWuL; dBYez: $CH5H6 = false; goto bFZQa; mv1Mf: if (empty($ucsAS) || !Session::isValidId($ucsAS)) { $ucsAS = Session::getId(); $aLxON = true; } else { Session::setId($ucsAS); $CH5H6 = true; } goto EGq1F; L3bfO: return $mf4Oy; goto uF3bl; c8uGu: if ($aLxON) { goto ZpgOy; ZpgOy: $ZH8nQ = 'Illuminate\\Http\\Response'; goto xd6ix; xd6ix: $H_BfR = 'Symfony\\Component\\HttpFoundation\\Response'; goto SYH1k; SYH1k: if ($mf4Oy instanceof $ZH8nQ) { $mf4Oy->header('api-token', $ucsAS); } else { if ($mf4Oy instanceof $H_BfR) { $mf4Oy->headers->set('api-token', $ucsAS); } } goto PyfSO; PyfSO: } goto L3bfO; kSGpD: $aLxON = false; goto dBYez; uAWuL: $cSn43->headers->set('api-param', $G2Lvz); goto P7PXc; bFZQa: $ucsAS = $this->get($cSn43, 'api-token'); goto mv1Mf; f9LpF: $WUr8a = $this->get($cSn43, 'api-device'); goto is4XJ; vW_oH: $cSn43->headers->set('api-version', $nHKqP); goto xoyU1; xoyU1: $mf4Oy = $aPZzJ($cSn43); goto c8uGu; EGq1F: $PZCJZ = Session::getId(); goto QzShd; is4XJ: $cSn43->headers->set('api-device', $WUr8a); goto UmWEd; QzShd: if ($PZCJZ && $PZCJZ != $ucsAS) { Session::setId($ucsAS); $CH5H6 = true; } goto UzX47; AFMKD: $cSn43->headers->set('api-token', $ucsAS); goto f9LpF; P7PXc: $nHKqP = $this->get($cSn43, 'api-version'); goto vW_oH; UzX47: if ($CH5H6) { Session::start(); } goto AFMKD; uF3bl: } private function get(Request &$cSn43, $rvTrU) { goto zUrgP; XRLe3: $gwXrh = $cSn43->header($rvTrU); goto Bu1Q5; HJiy9: if (!empty($gwXrh)) { return $gwXrh; } goto fnzI1; fnzI1: return null; goto URoUP; Bu1Q5: if (!empty($gwXrh)) { return $gwXrh; } goto xHh76; zUrgP: $M3Y7_ = str_replace('-', '_', $rvTrU); goto MgU1b; Qc1vG: if (!empty($gwXrh)) { return $gwXrh; } goto XRLe3; MgU1b: $gwXrh = Input::get($M3Y7_, null); goto Qc1vG; xHh76: $gwXrh = $cSn43->cookie($M3Y7_); goto HJiy9; URoUP: } private function getCookieSessionId(Request &$cSn43) { return $cSn43->cookie(config('session.cookie')); } }