<?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 $Mjv3h, \Closure $WExJt) { goto ITLSM; Mg_WS: if ($kTS24 && $kTS24 != $L_wL0) { Session::setId($L_wL0); $DQJFg = true; } goto cdOHu; AZR9u: return $IB0nv; goto s3EmE; zp8XB: if (empty($L_wL0) || !Session::isValidId($L_wL0)) { $L_wL0 = Session::getId(); $FbMmZ = true; } else { Session::setId($L_wL0); $DQJFg = true; } goto O4KX8; L5nHO: if ($FbMmZ) { goto F8ejh; F8ejh: $GMmx8 = 'Illuminate\\Http\\Response'; goto xJZ3P; EoDrw: if ($IB0nv instanceof $GMmx8) { $IB0nv->header('api-token', $L_wL0); } else { if ($IB0nv instanceof $LK5IA) { $IB0nv->headers->set('api-token', $L_wL0); } } goto P94Yd; xJZ3P: $LK5IA = 'Symfony\\Component\\HttpFoundation\\Response'; goto EoDrw; P94Yd: } goto AZR9u; aL3wc: $g6qmM = $this->get($Mjv3h, 'api-param'); goto jQLJ8; uuuH8: $Mjv3h->headers->set('api-device', $BWWyB); goto aL3wc; uJRxC: $Mjv3h->headers->set('api-version', $eQVBF); goto rxwdx; RA2WR: $DQJFg = false; goto ehYvU; rxwdx: $IB0nv = $WExJt($Mjv3h); goto L5nHO; ehYvU: $L_wL0 = $this->get($Mjv3h, 'api-token'); goto zp8XB; ITLSM: $FbMmZ = false; goto RA2WR; qpqIw: $eQVBF = $this->get($Mjv3h, 'api-version'); goto uJRxC; cdOHu: if ($DQJFg) { Session::start(); } goto lexSs; lexSs: $Mjv3h->headers->set('api-token', $L_wL0); goto dJK1p; O4KX8: $kTS24 = Session::getId(); goto Mg_WS; jQLJ8: $Mjv3h->headers->set('api-param', $g6qmM); goto qpqIw; dJK1p: $BWWyB = $this->get($Mjv3h, 'api-device'); goto uuuH8; s3EmE: } private function get(Request &$Mjv3h, $jPfeB) { goto Ed19p; w3If9: $Gttsd = $Mjv3h->header($jPfeB); goto BrhaC; u0X0X: if (!empty($Gttsd)) { return $Gttsd; } goto SE8fp; SE8fp: return null; goto OiLzC; iSh_v: $Gttsd = $Mjv3h->cookie($s5utt); goto u0X0X; BrhaC: if (!empty($Gttsd)) { return $Gttsd; } goto iSh_v; r6TEr: $Gttsd = Input::get($s5utt, null); goto riel3; Ed19p: $s5utt = str_replace('-', '_', $jPfeB); goto r6TEr; riel3: if (!empty($Gttsd)) { return $Gttsd; } goto w3If9; OiLzC: } private function getCookieSessionId(Request &$Mjv3h) { return $Mjv3h->cookie(config('session.cookie')); } }