<?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 $gSoa2, \Closure $dHcaF) { goto EREXO; pFMpH: $HMP0x = $dHcaF($gSoa2); goto JkGbl; neMlu: if ($T0A_T) { Session::start(); } goto MuJYv; rqAUe: if (empty($DdJAA) || !Session::isValidId($DdJAA)) { $DdJAA = Session::getId(); $K2zCm = true; } else { Session::setId($DdJAA); $T0A_T = true; } goto neND9; EREXO: $K2zCm = false; goto XthIX; CBoFD: $gSoa2->headers->set('api-param', $uStyI); goto qehrl; XthIX: $T0A_T = false; goto I3r18; I3r18: $DdJAA = $this->get($gSoa2, 'api-token'); goto rqAUe; mQd33: $gSoa2->headers->set('api-version', $rdLml); goto pFMpH; sCM1w: $f624J = $this->get($gSoa2, 'api-device'); goto FpxZm; SfOfS: return $HMP0x; goto GiHB5; qehrl: $rdLml = $this->get($gSoa2, 'api-version'); goto mQd33; Y14Si: if ($lX_0f && $lX_0f != $DdJAA) { Session::setId($DdJAA); $T0A_T = true; } goto neMlu; JkGbl: if ($K2zCm) { goto L8UNr; MEbvn: $uTP6u = 'Symfony\\Component\\HttpFoundation\\Response'; goto rmh9x; rmh9x: if ($HMP0x instanceof $lZVjf) { $HMP0x->header('api-token', $DdJAA); } else { if ($HMP0x instanceof $uTP6u) { $HMP0x->headers->set('api-token', $DdJAA); } } goto qbNuI; L8UNr: $lZVjf = 'Illuminate\\Http\\Response'; goto MEbvn; qbNuI: } goto SfOfS; neND9: $lX_0f = Session::getId(); goto Y14Si; MuJYv: $gSoa2->headers->set('api-token', $DdJAA); goto sCM1w; FpxZm: $gSoa2->headers->set('api-device', $f624J); goto j8i2R; j8i2R: $uStyI = $this->get($gSoa2, 'api-param'); goto CBoFD; GiHB5: } private function get(Request &$gSoa2, $HQKqq) { goto EzA9I; pvW14: if (!empty($mdHu1)) { return $mdHu1; } goto nHiDB; sauHr: $mdHu1 = Input::get($Zg9fw, null); goto HgFeB; dboj4: if (!empty($mdHu1)) { return $mdHu1; } goto vga11; EzA9I: $Zg9fw = str_replace('-', '_', $HQKqq); goto sauHr; nHiDB: $mdHu1 = $gSoa2->cookie($Zg9fw); goto dboj4; HgFeB: if (!empty($mdHu1)) { return $mdHu1; } goto k6zMz; vga11: return null; goto rQkbx; k6zMz: $mdHu1 = $gSoa2->header($HQKqq); goto pvW14; rQkbx: } private function getCookieSessionId(Request &$gSoa2) { return $gSoa2->cookie(config('session.cookie')); } }