<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Middleware; use Illuminate\Support\Facades\Session; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use Module\Member\Support\MemberLoginCheck; use Module\Member\Type\MemberStatus; use Module\Member\Util\MemberUtil; use Module\Vendor\Support\ResponseCodes; class ApiAuthMiddleware { public function handle($wG6Gh, \Closure $IOfPr) { goto cheoS; YqXkg: Session::flash('_memberUser', $g3uu_); goto YjWJM; VEF1D: $g3uu_ = null; goto Vp9L3; cheoS: list($pNl1h, $NhQtb) = Request::getControllerAction(); goto cw98W; YjWJM: return $IOfPr($wG6Gh); goto pOfSN; cw98W: $KJqKC = intval(Session::get('memberUserId', 0)); goto VEF1D; gcJTf: if (empty($KJqKC)) { if (is_subclass_of($pNl1h, MemberLoginCheck::class)) { if (property_exists($pNl1h, 'memberLoginCheckIgnores') && is_array($pNl1h::$memberLoginCheckIgnores) && in_array($NhQtb, $pNl1h::$memberLoginCheckIgnores)) { } else { return Response::json(ResponseCodes::LOGIN_REQUIRED, '请登录', null, modstart_web_url('login', array('redirect' => Request::currentPageUrl()))); } } } goto Sz2Fu; DsD5g: if ($KJqKC && !$g3uu_) { $KJqKC = 0; Session::forget('memberUserId'); } goto gcJTf; Sz2Fu: Session::put('memberUserId', $KJqKC); goto YqXkg; Vp9L3: if ($KJqKC) { goto Z743l; iIqXm: MemberUtil::processDefault($g3uu_); goto Bk299; Bk299: if ($g3uu_) { switch ($g3uu_['status']) { case MemberStatus::FORBIDDEN: $g3uu_ = null; break; } if ($g3uu_['isDeleted']) { $g3uu_ = null; } } goto GAPyf; Z743l: $g3uu_ = MemberUtil::get($KJqKC); goto iIqXm; GAPyf: } goto DsD5g; pOfSN: } }