<?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 $fzeTQ, \Closure $ayFRd) { goto gZQUO; M1ilz: $hy33A = $this->get($fzeTQ, 'api-token'); goto YWvoA; bW2ua: if ($DL6hH && $DL6hH != $hy33A) { Session::setId($hy33A); $Pc3HQ = true; } goto sF4QE; kp3C5: $Pc3HQ = false; goto M1ilz; CkSGj: $fzeTQ->headers->set('api-version', $kNtt8); goto FjC9S; NpKHh: $fzeTQ->headers->set('api-param', $Cq9Yi); goto edh14; EyqgZ: $hVdrV = $this->get($fzeTQ, 'api-device'); goto sbz_i; sbz_i: $fzeTQ->headers->set('api-device', $hVdrV); goto HJIWG; gZQUO: $BXYfh = false; goto kp3C5; HJIWG: $Cq9Yi = $this->get($fzeTQ, 'api-param'); goto NpKHh; SZP57: if ($BXYfh) { goto oEEiB; oEEiB: $vmGev = 'Illuminate\\Http\\Response'; goto B1kiG; B1kiG: $OYfg1 = 'Symfony\\Component\\HttpFoundation\\Response'; goto Hq6cS; Hq6cS: if ($YD5di instanceof $vmGev) { $YD5di->header('api-token', $hy33A); } else { if ($YD5di instanceof $OYfg1) { $YD5di->headers->set('api-token', $hy33A); } } goto H0FkJ; H0FkJ: } goto XHJMJ; hY0qS: $fzeTQ->headers->set('api-token', $hy33A); goto EyqgZ; YWvoA: if (empty($hy33A) || !Session::isValidId($hy33A)) { $hy33A = Session::getId(); $BXYfh = true; } else { Session::setId($hy33A); $Pc3HQ = true; } goto wIwBf; XHJMJ: return $YD5di; goto HgRuz; wIwBf: $DL6hH = Session::getId(); goto bW2ua; sF4QE: if ($Pc3HQ) { Session::start(); } goto hY0qS; FjC9S: $YD5di = $ayFRd($fzeTQ); goto SZP57; edh14: $kNtt8 = $this->get($fzeTQ, 'api-version'); goto CkSGj; HgRuz: } private function get(Request &$fzeTQ, $VFU9l) { goto zmRrx; Vo3AA: return null; goto fpm4S; ZjQ61: $HDpl6 = $fzeTQ->cookie($z7ari); goto qDZhz; zmRrx: $z7ari = str_replace('-', '_', $VFU9l); goto gb5h5; gb5h5: $HDpl6 = Input::get($z7ari, null); goto COasn; COasn: if (!empty($HDpl6)) { return $HDpl6; } goto PCdPA; PCdPA: $HDpl6 = $fzeTQ->header($VFU9l); goto TV3VL; TV3VL: if (!empty($HDpl6)) { return $HDpl6; } goto ZjQ61; qDZhz: if (!empty($HDpl6)) { return $HDpl6; } goto Vo3AA; fpm4S: } private function getCookieSessionId(Request &$fzeTQ) { return $fzeTQ->cookie(config('session.cookie')); } }