<?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($dwwIV); public function handle($U5_Oe, \Closure $pnI5g) { goto aDpet; K60e7: if ($qwA4o != $o3hyb) { goto VGHT4; VGHT4: Log::info('MS.SignNotMatch : ' . $o3hyb); goto WpH6R; WpH6R: $pTwJr = $this->signNotMatch(); goto A0W52; A0W52: if ($pTwJr['code']) { return $pTwJr['data']; } goto oXPZO; oXPZO: } goto en4vv; etFqF: $A064T = explode('@', $i98uu); goto qJdlA; nQMqY: $dwwIV = Input::get('key'); goto ar7FN; en4vv: $i98uu = Route::currentRouteAction(); goto etFqF; qJdlA: if (isset($A064T[0])) { $g8eaS = $A064T[0]; } else { $g8eaS = null; } goto uMaPN; PF9RK: $Sy_B1 = array('timestamp' => $emspg, 'key' => $dwwIV); goto Sr9G2; UhtG9: if (empty($qwA4o)) { return Response::json(-1, 'sign empty'); } goto PF9RK; ar7FN: if (empty($dwwIV)) { return Response::json(-1, 'key empty'); } goto zNXyX; zNXyX: $IJu4T = $this->getSecretByKey($dwwIV); goto reCk1; uMaPN: if (isset($A064T[1])) { $Haghy = $A064T[1]; } else { $Haghy = null; } goto ekl4d; NLpTH: Session::flash('_openApiKey', $dwwIV); goto uBQsz; ekl4d: if (!Str::startsWith($g8eaS, '\\')) { $g8eaS = '\\' . $g8eaS; } goto NLpTH; ZPsoy: if (empty($emspg)) { return Response::json(-1, 'timestamp empty'); } goto ZAAYn; aDpet: $qwA4o = Input::get('sign'); goto G39k9; reCk1: if (empty($IJu4T)) { return Response::json(-1, 'invalid key'); } goto ZPsoy; Sr9G2: $o3hyb = SignUtil::common($Sy_B1, $IJu4T); goto K60e7; tRyFa: return $pnI5g($U5_Oe); goto Yx5Vl; uBQsz: Session::flash('_openApiSecret', $IJu4T); goto tRyFa; ZAAYn: if (($emspg < time() - 1800 || $emspg > time() + 1800) && empty($khGCQ['isDemo'])) { return Response::json(-1, 'timestamp not valid (' . time() . ')'); } goto UhtG9; G39k9: $emspg = Input::get('timestamp'); goto nQMqY; Yx5Vl: } protected function signNotMatch() { return Response::generate(-1, 'sign error', Response::json(-1, 'sign error')); } }