<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\OpenApi\Middleware; use Illuminate\Http\Request; use ModStart\App\Core\AccessGate; use ModStart\App\Core\CurrentApp; use ModStart\Core\Input\Response; use ModStart\Support\Manager\FieldManager; use ModStart\Support\Manager\WidgetManager; class BootstrapMiddleware { private static $gates = array(); public static function addGate($ottBC) { self::$gates[] = $ottBC; } public function handle(Request $fzeTQ, \Closure $ayFRd) { goto WgsUo; SbJ7n: return $ayFRd($fzeTQ); goto EHfVi; np2Qe: WidgetManager::registerBuiltinWidgets(); goto qQ_Na; SrtvV: FieldManager::registerBuiltinFields(); goto np2Qe; qQ_Na: if (file_exists($tqFow = modstart_open_api_path('bootstrap.php'))) { require $tqFow; } goto SbJ7n; mSEAA: foreach (self::$gates as $OV1o4) { goto TVYfE; nmBmx: $Z5nZL = $zVV30->check($fzeTQ); goto hWGG6; hWGG6: if (Response::isError($Z5nZL)) { return $Z5nZL; } goto mwiXF; TVYfE: $zVV30 = app($OV1o4); goto nmBmx; mwiXF: } goto SrtvV; WgsUo: if (method_exists(CurrentApp::class, 'set')) { CurrentApp::set(CurrentApp::OPEN_API); } goto mSEAA; EHfVi: } }