<?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 $U5_Oe, \Closure $pnI5g) { goto RjgQz; dq6Tu: $U5_Oe->headers->set('api-version', $p2YtW); goto o8E1D; Qi9tv: if ($Tt2Wc && $Tt2Wc != $yw_wb) { Session::setId($yw_wb); $H9cVd = true; } goto Cp3Jb; d633O: $Tt2Wc = Session::getId(); goto Qi9tv; RjgQz: $O9Z5M = false; goto b4_hG; b4_hG: $H9cVd = false; goto N1tvg; aYKoj: $U5_Oe->headers->set('api-device', $QYa7I); goto H_Mfu; gVfo7: $QYa7I = $this->get($U5_Oe, 'api-device'); goto aYKoj; o8E1D: $CqM8X = $pnI5g($U5_Oe); goto pXIQg; hmJOU: $U5_Oe->headers->set('api-param', $EK3Rl); goto cWaB4; pXIQg: if ($O9Z5M) { goto rETN6; wwUlr: if ($CqM8X instanceof $qV6xC) { $CqM8X->header('api-token', $yw_wb); } else { if ($CqM8X instanceof $v3HTY) { $CqM8X->headers->set('api-token', $yw_wb); } } goto XEn21; TLQIm: $v3HTY = 'Symfony\\Component\\HttpFoundation\\Response'; goto wwUlr; rETN6: $qV6xC = 'Illuminate\\Http\\Response'; goto TLQIm; XEn21: } goto Sy0oc; WrtTH: $U5_Oe->headers->set('api-token', $yw_wb); goto gVfo7; H_Mfu: $EK3Rl = $this->get($U5_Oe, 'api-param'); goto hmJOU; N1tvg: $yw_wb = $this->get($U5_Oe, 'api-token'); goto DBhTd; cWaB4: $p2YtW = $this->get($U5_Oe, 'api-version'); goto dq6Tu; Cp3Jb: if ($H9cVd) { Session::start(); } goto WrtTH; Sy0oc: return $CqM8X; goto Wfijh; DBhTd: if (empty($yw_wb) || !Session::isValidId($yw_wb)) { $yw_wb = Session::getId(); $O9Z5M = true; } else { Session::setId($yw_wb); $H9cVd = true; } goto d633O; Wfijh: } private function get(Request &$U5_Oe, $dwwIV) { goto jfW4n; UqSwP: if (!empty($wvO30)) { return $wvO30; } goto GFyzR; voBVq: $wvO30 = Input::get($DhEzD, null); goto UqSwP; GFyzR: $wvO30 = $U5_Oe->header($dwwIV); goto F7KTM; EKWsk: if (!empty($wvO30)) { return $wvO30; } goto p5a5B; p5a5B: return null; goto CvhTD; jfW4n: $DhEzD = str_replace('-', '_', $dwwIV); goto voBVq; VHTOr: $wvO30 = $U5_Oe->cookie($DhEzD); goto EKWsk; F7KTM: if (!empty($wvO30)) { return $wvO30; } goto VHTOr; CvhTD: } private function getCookieSessionId(Request &$U5_Oe) { return $U5_Oe->cookie(config('session.cookie')); } }