<?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 $RDnT0, \Closure $LeO9R) { goto aRXbR; EMJDt: if ($QhwSl && $QhwSl != $x0qYG) { Session::setId($x0qYG); $dLRhO = true; } goto aAxp5; FacAk: return $Lq983; goto sVLjG; hLAka: $RDnT0->headers->set('api-version', $O7JyT); goto Todpc; gKm8i: $dLRhO = false; goto GEAEN; aRXbR: $qkpOU = false; goto gKm8i; ug5ui: if (empty($x0qYG) || !Session::isValidId($x0qYG)) { $x0qYG = Session::getId(); $qkpOU = true; } else { Session::setId($x0qYG); $dLRhO = true; } goto Uf0fm; C0KDS: $RDnT0->headers->set('api-token', $x0qYG); goto WXgG6; Ag5Qm: $RDnT0->headers->set('api-device', $NxVPw); goto GPyDG; GPyDG: $QoZjJ = $this->get($RDnT0, 'api-param'); goto JS9io; Uf0fm: $QhwSl = Session::getId(); goto EMJDt; MAGZv: if ($qkpOU) { goto xGU8C; cIDiT: $eVI4O = 'Symfony\\Component\\HttpFoundation\\Response'; goto LE1ty; LE1ty: if ($Lq983 instanceof $U24pG) { $Lq983->header('api-token', $x0qYG); } else { if ($Lq983 instanceof $eVI4O) { $Lq983->headers->set('api-token', $x0qYG); } } goto n876z; xGU8C: $U24pG = 'Illuminate\\Http\\Response'; goto cIDiT; n876z: } goto FacAk; aAxp5: if ($dLRhO) { Session::start(); } goto C0KDS; JS9io: $RDnT0->headers->set('api-param', $QoZjJ); goto BgLt1; GEAEN: $x0qYG = $this->get($RDnT0, 'api-token'); goto ug5ui; Todpc: $Lq983 = $LeO9R($RDnT0); goto MAGZv; WXgG6: $NxVPw = $this->get($RDnT0, 'api-device'); goto Ag5Qm; BgLt1: $O7JyT = $this->get($RDnT0, 'api-version'); goto hLAka; sVLjG: } private function get(Request &$RDnT0, $GUcFO) { goto rGBZ2; rGBZ2: $elsPQ = str_replace('-', '_', $GUcFO); goto xY30X; oymLH: if (!empty($ib3B9)) { return $ib3B9; } goto ulmQe; kpwPX: $ib3B9 = $RDnT0->header($GUcFO); goto oymLH; ZABOd: return null; goto EHIEw; xY30X: $ib3B9 = Input::get($elsPQ, null); goto n0UBK; ulmQe: $ib3B9 = $RDnT0->cookie($elsPQ); goto HnzC8; HnzC8: if (!empty($ib3B9)) { return $ib3B9; } goto ZABOd; n0UBK: if (!empty($ib3B9)) { return $ib3B9; } goto kpwPX; EHIEw: } private function getCookieSessionId(Request &$RDnT0) { return $RDnT0->cookie(config('session.cookie')); } }