<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\OpenApi\Middleware; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Session; use Illuminate\Support\Str; use ModStart\Core\Input\Response; use ModStart\Core\Util\SignUtil; abstract class AbstractKeySecretSimpleSignCheckMiddleware { protected abstract function getSecretByKey($ax5t3); public function handle($MRMCA, \Closure $Vqu7c) { goto g_ff0; LLJE4: $npuuV = explode('@', $H8T3G); goto lJqpr; Vx5l3: Session::flash('_openApiKey', $ax5t3); goto WSj7v; wBi0s: if (empty($fryoH)) { return Response::json(-1, 'sign empty'); } goto ou1io; g_ff0: $fryoH = Input::get('sign'); goto vUi36; po3TC: if (($tfKvy < time() - 1800 || $tfKvy > time() + 1800) && empty($uqt3d['isDemo'])) { return Response::json(-1, 'timestamp not valid (' . time() . ')'); } goto wBi0s; LIVsF: if (empty($zDVvb)) { return Response::json(-1, 'invalid key'); } goto MGIQ5; lJqpr: if (isset($npuuV[0])) { $LNco0 = $npuuV[0]; } else { $LNco0 = null; } goto HXGX_; LaHNR: $uVev_ = SignUtil::common($psLH5, $zDVvb); goto Fm6Lf; HXGX_: if (isset($npuuV[1])) { $jyXp8 = $npuuV[1]; } else { $jyXp8 = null; } goto E46N4; Fm6Lf: if ($fryoH != $uVev_) { goto QJMha; QJMha: Log::info('MS.SignNotMatch : ' . $uVev_); goto J7fnB; J7fnB: $JOw_A = $this->signNotMatch(); goto Z894g; Z894g: if ($JOw_A['code']) { return $JOw_A['data']; } goto qdaB8; qdaB8: } goto sOALl; T4NoC: $zDVvb = $this->getSecretByKey($ax5t3); goto LIVsF; MGIQ5: if (empty($tfKvy)) { return Response::json(-1, 'timestamp empty'); } goto po3TC; XGdQg: return $Vqu7c($MRMCA); goto uMKFX; E46N4: if (!Str::startsWith($LNco0, '\\')) { $LNco0 = '\\' . $LNco0; } goto Vx5l3; tX5nM: if (empty($ax5t3)) { return Response::json(-1, 'key empty'); } goto T4NoC; vUi36: $tfKvy = Input::get('timestamp'); goto yOTvq; sOALl: $H8T3G = Route::currentRouteAction(); goto LLJE4; ou1io: $psLH5 = array('timestamp' => $tfKvy, 'key' => $ax5t3); goto LaHNR; WSj7v: Session::flash('_openApiSecret', $zDVvb); goto XGdQg; yOTvq: $ax5t3 = Input::get('key'); goto tX5nM; uMKFX: } protected function signNotMatch() { return Response::generate(-1, 'sign error', Response::json(-1, 'sign error')); } }