<?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 $MRMCA, \Closure $Vqu7c) { goto Gxv6t; zN2Tz: if ($XQJZ5 && $XQJZ5 != $IH7ir) { Session::setId($IH7ir); $lu_2X = true; } goto EvMWz; fgVBc: $MRMCA->headers->set('api-device', $hR6Si); goto juSbz; LtfW1: return $i1_1k; goto IvmZH; N9pTY: $IH7ir = $this->get($MRMCA, 'api-token'); goto ED8H0; a7lHH: $MRMCA->headers->set('api-token', $IH7ir); goto zFUJ9; Pof_0: $MRMCA->headers->set('api-version', $C5m6k); goto I6LiM; Gxv6t: $t3j_N = false; goto h_oI_; ED8H0: if (empty($IH7ir) || !Session::isValidId($IH7ir)) { $IH7ir = Session::getId(); $t3j_N = true; } else { Session::setId($IH7ir); $lu_2X = true; } goto Yz42g; juSbz: $JQhSI = $this->get($MRMCA, 'api-param'); goto wQX6O; I6LiM: $i1_1k = $Vqu7c($MRMCA); goto OMmuU; EvMWz: if ($lu_2X) { Session::start(); } goto a7lHH; OMmuU: if ($t3j_N) { goto g9c1v; g9c1v: $vajcl = 'Illuminate\\Http\\Response'; goto ArYSq; KLbin: if ($i1_1k instanceof $vajcl) { $i1_1k->header('api-token', $IH7ir); } else { if ($i1_1k instanceof $kHZJn) { $i1_1k->headers->set('api-token', $IH7ir); } } goto OWlcZ; ArYSq: $kHZJn = 'Symfony\\Component\\HttpFoundation\\Response'; goto KLbin; OWlcZ: } goto LtfW1; Yz42g: $XQJZ5 = Session::getId(); goto zN2Tz; fm9hW: $C5m6k = $this->get($MRMCA, 'api-version'); goto Pof_0; h_oI_: $lu_2X = false; goto N9pTY; zFUJ9: $hR6Si = $this->get($MRMCA, 'api-device'); goto fgVBc; wQX6O: $MRMCA->headers->set('api-param', $JQhSI); goto fm9hW; IvmZH: } private function get(Request &$MRMCA, $ax5t3) { goto R80g9; CI41y: $FT9zA = Input::get($ulez8, null); goto py5wV; hQnl1: return null; goto XfOn0; ORhI0: if (!empty($FT9zA)) { return $FT9zA; } goto hQnl1; sVHJE: $FT9zA = $MRMCA->header($ax5t3); goto H6SwK; H6SwK: if (!empty($FT9zA)) { return $FT9zA; } goto wVFPd; R80g9: $ulez8 = str_replace('-', '_', $ax5t3); goto CI41y; py5wV: if (!empty($FT9zA)) { return $FT9zA; } goto sVHJE; wVFPd: $FT9zA = $MRMCA->cookie($ulez8); goto ORhI0; XfOn0: } private function getCookieSessionId(Request &$MRMCA) { return $MRMCA->cookie(config('session.cookie')); } }